Loose click method

The place to discuss FoxPro issues not directly related to ProMatrix.

Loose click method

Postby btiguy » Thu Mar 12, 2015 11:09 am

Myform has a grid and I have code in the click of grdMine.Column2.text1.click. I often change the source to the grid and then loose the code in the click. How can I restore it programmatically?
TIA
Don
btiguy
 
Posts: 455
Joined: Mon Jun 21, 2010 4:03 pm

Re: Loose click method

Postby cti2 » Fri Mar 13, 2015 8:05 am

Yeah this is a PITA, I also loose the controlsource on each column.
If you change the source often you can open the form as a table and hack it that way.
Use MyForm.SCX
BROWSE
Now find the grid and its properties/method.
Open the memo field and edit the source.
This way VFP doesn't kill a bunch of stuff.
All of the controlsource references in the grid should NOT have the table as part of the reference, else when you change the source of the grid, it will not be happy.
Close MyForm.SCX and try running in the form.
You could get sophisticated and write a prg to do this.
HTH, Pete Ryder
cti2
 
Posts: 181
Joined: Wed Oct 13, 2010 6:38 am

Re: Loose click method

Postby Bob » Sat Mar 14, 2015 9:38 am

I kinda remember that changing the recordsource of a grid required a trick ... first set the recordsource to an empty string, then the desired value. If the grid uses the fields in column order, the control source is set automatically.

Hope this works for you ....
Bob
 
Posts: 718
Joined: Mon Jun 14, 2010 6:53 am
Location: Near Albany, NY


Return to Visual FoxPro

Who is online

Users browsing this forum: No registered users and 2 guests

cron