PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → Simplified Drag & Drop with Tables
Simplified Drag & Drop with Tables
Iniciado por VEGEboss, out., 10 2019 12:47 PM - 1 resposta
Membro registado
88 mensagems
Popularité : +2 (2 votes)
Publicado em outubro, 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
Membro registado
52 mensagems
Popularité : +3 (3 votes)
Publicado em outubro, 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.
Mensagem modificada, outubro, 11 2019 - 1:20 PM