Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you add code in gotfocus for dynamic built grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01409625
Message ID:
01409753
Vues:
39
>'This' in a delegate method reference the object the method belongs to.
>You've to use AEVENTS(ArrayName,1) in the delegate method to get object reference of the event source
>
>
>
>>Ok, I created a method gotfocus_msg method to call in the bindevent, however it doesn't seem to like retrieve the value from the grid cell. I get a message saying
>>
>>
>>Property VALUE is not found
>>
>>
>>Here is my bindevent
>>
>>**buildgridmethod
>>....
>>
>>
>>			.column4.header1.caption = "How Much"
>>			.column4.header1.ToolTipText = 'How much consumed'		
>>			.column4.width = 61	
>>			.column4.Enabled = .t.
>>			.column4.Text1.DisabledBackColor 	= RGB(255,255,255)
>>			.column4.Text1.DisabledForeColor = RGB(0,0,0)	
>>			.column4.controlsource = "crs_grid3.crshowmuch"
>>
>>
>>BINDEVENT(thisform.g3.column4.Text1 ,[GotFocus], thisform, [gotfocus_msg],1)
>>
>>
>>and here is my gotfocus_msg method that I want to call when the grid column4 gotfocus
>>
>>**gotfocus_msg method
>>MESSAGEBOX('gotfocus'+STR(this.value),0,'')
>>thisform.celloldvalue = this.Value
>>
>>
>>I'm not sure if this the way I am suppose to do gotfocus and lostfocus bindevent, but it seems like it cannot resolve the value in grid cell. I'm I missing something here?

cool. I got to the value using AEVENT, but it seems to give me the value of the first row in the grid. What if I am trying to get the value of lets say 4th row in the grid? When I click on 4th row, it seems like the gotfocus is capturing the first row value not the correct clicked 4th row.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform