PRB: Values Are Not Updated in Each Column When Changing Rows
ID: Q141987
|
The information in this article applies to:
-
Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b
SYMPTOMS
Changing the ActiveRow of a grid does not update the values of the object
in every column.
CAUSE
Only the object that receives the focus will have an updated value.
WORKAROUND
- Create a new property of the form named oldrow and assign an
initial value of -1.
- Place the following code in the grid's AfterRowColChange event:
******* Begin AfterRowColChange *********
IF This.ActiveRow<>Thisform.oldrow
Thisform.oldrow=This.ActiveRow
FOR lnI=1 TO This.ColumnCount
lcsource=This.Columns(lnI).ControlSource
IF TYPE(lcsource)<>"G" AND TYPE(lcsource)<>"M"
This.Columns(lnI).SetAll("VALUE",&lcsource)
ENDIF
ENDFOR
ENDIF
******** End AfterRowColChange *************
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
- Create a new form.
- Add Vfp\Samples\Data\Employee.dbf to the DataEnvironment of
the form.
- Create a grid by dragging the table from the DataEnvironment
to the form.
- Run the form.
- Open the Debug window, and type the following on the left
side of the Debug window:
_Screen.Forms(1).Grid1.Column1.Text1.Value
_Screen.Forms(1).Grid1.Column2.Text1.Value
_Screen.Forms(1).Grid1.Column3.Text1.Value
_Screen.Forms(1).Grid1.Column4.Text1.Value
- Select a cell inside the first column of the grid.
- Only Grid1.Column1.Text1.Value is updated in the debug window. None of
the other values are updated.
Additional query words:
VFoxWin
Keywords : FxprgGeneral
Version : 3.00 3.00b
Platform : WINDOWS
Issue type :