Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid seems to loose track of what row it´s on (VFP6 /SP3)
Message
From
30/06/2000 09:47:11
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Grid seems to loose track of what row it´s on (VFP6 /SP3)
Miscellaneous
Thread ID:
00387036
Message ID:
00387036
Views:
46
Let's assume a grid with 2 columns.
Column1's CurrentControl is a checkbox.
Column2's CurrentControl is a spinner.
The spinner should only be enabled if the checkbox is checked.

The code in the spinner GOTFOCUS method is:
THIS.ENABLED=THIS.PARENT.PARENT.COLUMN1.VALUE, i.e. .T. if the checkbox is checked, otherwise .F.

This works initially to some degree, but as soon as I click on a checkbox it stops working for all spinners in the grid, and no amount of refreshing or what have you will get it back on track.

I have had a similar problem once with calculations (Col3.Txt1.Value=Col2.Txt1.Value * .Col1.Txt1.Value) and solved id by
looping through the Columns and setting the CONTROLSOURCE property in the AFTEROWCOLCHANGE method.

LPARAMETERS nColIndex
FOR i=1 TO THIS.COLUMNCOUNT
THIS.COLUMNS(i).CONTROLSOURCE=THIS.COLUMNS(i).CONTROLSOURCE
ENDFOR

Regards

Peter
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Next
Reply
Map
View

Click here to load this message in the networking platform