PRB: Grid Column's CurrentControl Reverts to Text1 Default (132478)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
This article was previously published under Q132478 SYMPTOMS
When you use the SQL SELECT command, and set the grid's RecordSource
property to the newly queried cursor file, the grid column's current
control (Check1 for example) reverts to Text1 (the default control).
CAUSE
The SQL SELECT code includes a SELECT ... INTO CURSOR TESTCURSOR command,
which is the RecordSource for the grid. When this happens, the original
cursor must be destroyed before the new cursor can be created. When the
orginal cursor is destroyed, the grid columns and the controls in the
columns are also destroyed, as well as the check box. In this case, the
check box is destroyed. The SQL SELECT code sets the grid's RecordSource to
the new cursor. At this point, the columns are automatically created with
the default settings. There is no code to recreate the check box.
WORKAROUND
To retain the controls in the grid columns, add the following statement
prior to executing the SQL SELECT command:
THISFORM.Grid1.RecordSource = ""
For more information, please see the example workaround in the More
Information section of this article.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 2/15/2000 |
---|
Keywords: | kbcode KB132478 |
---|
|