FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Programmed drag and drop between two tables
Programmed drag and drop between two tables
Débuté par Wilfried, 21 oct. 2014 14:40 - 3 réponses
Connectez-vous…
Wilfried
#1
Posté le 21 octobre 2014 - 14:40
Hello,
I've been breaking my head over this one. probably due to lack of experience.
I have two memory tables filled by programming. I want to make a drag and drop between them so taht when i drop a line of table_1 in table_2 i can start a procedure that does some things. I want to give taht procedure the Id i have in table_1 as a parameter.
Since the two tables are totaly different from each other i must use programmed drag and drop.
I read the complete helpfile on the subject. Done word for word what it says, but nothing works. The target table does not accept my drop.
I can't find a useful example with a similar situation, only DnD between listboxes, no tables.
Can anyone help me ?
Thanks a lot in advance,
Wilfried
Signaler
0
0
Paulo Oliveira
#2
Posté le 21 octobre 2014 - 15:20
Did you check the window Window_DND provided with windev?
It's between treeviews (source) and tables (target) but it can give you some hints on how to program drag/drop
Signaler
0
0
Jose Antonio Garrido
#3
Posté le 21 octobre 2014 - 16:58
Hi.
I had some difficulties the first time too.
This is my actual code:
Table 1 dndDragOver process
nHoveredRow is int =gproc_HoveredRow(MySelf..Name) IF nHoveredRow < 0 THEN DnDCursor(dndNone) RETURN END IF TABLE_Facturas..NewLine THEN DnDCursor(dndNone) RETURN END IF nHoveredRow = TABLE_Facturas THEN DnDCursor(dndNone) RETURN END DnDCursor(dndCopy) Table 1 dndDrop process
IF _DND.SourceControl <> TABLE_facturas_lineas..Name THEN RETURN nHoveredRow is int =gproc_HoveredRow(MySelf..Name) IF YesNo("yess = Copyy, Noo = Movee") THEN FOR EACH SELECTED ROW OF TABLE_facturas_lineas HReadSeekFirst( QRY_table_facturas_lineas,facturas_lineasID,TABLE_facturas_lineas.COL_facturas_lineasID) QRY_table_facturas_lineas.IDfactura = TABLE_Facturas[nHoveredRow].COL_IdFactura HAdd( QRY_table_facturas_lineas) END ELSE FOR EACH SELECTED ROW OF TABLE_facturas_lineas TABLE_facturas_lineas.COL_IDfactura = TABLE_Facturas[nHoveredRow].COL_IdFactura TableSave(TABLE_facturas_lineas) END END TableDisplay(TABLE_facturas_lineas)
Table 2, the one where i click to drag the rows out of it have no code at all.
Drag and Drop "Is Target" and "Is Source" options are disabled on both tables.
Regards,
José Antonio.
Signaler
0
0
Wilfried
#4
Posté le 29 octobre 2014 - 12:06
Thanks,
finally figured it out. Your reply was very helpfull.
Wilfried
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte