PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Simplified Drag & Drop with Tables
Simplified Drag & Drop with Tables
Started by VEGEboss, Oct., 10 2019 12:47 PM - 1 reply
Registered member
88 messages
Popularité : +2 (2 votes)
Posted on October, 10 2019 - 12:47 PM
hello folks

I have 2 tables in the same Windows and I have activated
the DnD Source on the Table A and the DnD Target on the Table B

When I drag row(s) from A to B I correctly get a copy of the data
in the second table

The question is: can I know HOW MANY rows are passing from
A to B to automatically change some data in the B tables?

If I put some code in the "Drop in Target" Section, the rows
are NO MORE COPIED and I can't understand how to workaround...

Thank you very much
Registered member
52 messages
Popularité : +3 (3 votes)
Posted on October, 11 2019 - 12:53 PM
Not sure if you want this:

add "DROP IN TARGET DRAG/DROP (DNDDROP) ON table_target" event
and this code:

Rows_to_Drop is int = ListSelectCount(_DND.SourceControl)


Later, I saw what you meant .... OK

try this:

at "DROP IN TARGET DRAG/DROP (DNDDROP) ON table_target" event

Rows_to_Drop is int = ListSelectCount(_DND.SourceControl)
FOR EACH SELECTED ROW OF TABLE_SOURCE
TableAdd(TABLE_TARGET, TABLE_SOURCE[TABLE_SOURCE])
END


Notice: TABLE_SOURCE and TABLE_TARGET must have same number of columns, but you can change code to avoid this.
Message modified, October, 11 2019 - 1:20 PM