Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid with command button column
Message
De
20/11/2004 04:07:49
 
 
À
19/11/2004 22:53:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00962258
Message ID:
00963175
Vues:
11
>Jojo,
>
>I am using VFP6 and this is my situation:
>
>I dropped a grid on a form, set its RecordSourceType to Alias, then RecordSource to Customer. ColumnCount is 3, first two columns' ControlSource to CustCode field and CustName field. In the 3rd column I removed the textbox control and dropped two commandbuttons and named them cmdDelete and cmdRecall.
>
>In the Click event of cmdDelete:
>
>
>DELETE
>ThisForm.Grid1.Refresh()
>
>
>In the Click event of cmdRecall:
>
>
>RECALL
>ThisForm.Grid1.Refresh()
>
>
>Then, in the DynamicCurrentControl of the Column3- IIF( DELETED(), "cmdRecall", "cmdDeleted" )
>Then, Column3.Sparse = .F.
>
>
>Upon running the form, the commandbuttons show up properly according to the Deleted state of the record. Clicking on the buttons the FIRST TIME will work ok (i.e., if you try to click on the Delete button, it will delete the record (DeleteMark = .T.), and cmdRecall becomes the currentcontrol, as expected.)
>
>Clicking on the SAME record a second time will no longer work! You have to go to another record then go back for it work.
>
>Any ideas on why?
>
>Thanks

Because the focus still on the active button.
( move the mouse out/in of the button cell )
Solutions:
a) force to exit
* cmdDeleted.CLICK
DELETE
this.Enable = .F.
* no grid refresh, it is useless

* cmdRecall.CLICK
RECALL
this.Enable = .F.

* cmdDeleted.LostFocus
this.Enable = .T.

* cmdRecall.LostFocus
this.Enable = .T.
b) use a single graph checkbox
parentColumn.Bound = .F. && <=== attention
Style = graphical
picture = 'deleted'
downpicture = 'recall'
Checkbox.Controlsource = (DELETED()) && <=== attention

* ckeckbox.CLICK
IF DELETED()
	RECALL
ELSE
	DELETE
ENDIF
checkbox::refresh
Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform