Microsoft KB Archive/141987

= PRB: Values Are Not Updated in Each Column When Changing Rows =

Article ID: 141987

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition

-



This article was previously published under Q141987



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.



Steps to Reproduce Behavior
 Create a new form. Add Vfp\Samples\Data\Employee.dbf to the DataEnvironment of the form.</li> Create a grid by dragging the table from the DataEnvironment to the form.</li> Run the form.</li>  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 </li> Select a cell inside the first column of the grid.</li> Only Grid1.Column1.Text1.Value is updated in the debug window. None of the other values are updated.</li></ol>

Additional query words: VFoxWin

Keywords: KB141987

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.