PRB: DataGrid or DbGrid May Not Display Data
Article ID: 193094
Article Last Modified on 4/22/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Professional Edition, when used with:
- Microsoft Visual Basic 6.0 Professional Edition, when used with:
- Microsoft Visual Basic 5.0 Enterprise Edition, when used with:
- Microsoft Visual Basic 6.0 Enterprise Edition, when used with:
This article was previously published under Q193094
SYMPTOMS
In Visual Basic 6.0, after binding a DataGrid control to an ActiveX Data
Objects (ADO) data control, you may not see any data display in the grid.
This behavior occurs if you set or change any property of the Layout
Property page of the DataGrid without executing the Retrieve Fields option
of the DataGrid first.
You may see the same behavior occur in Visual Basic 5.0 if you use a DBGrid
control.
CAUSE
The data fields are not retrieved yet.
RESOLUTION
The Layout Property page for either the DataGrid or the DBGrid controls
contains properties available at design-time only and needs to be set after
all fields are available or retrieved.
To work around this problem, you need to run the Retrieve Fields method
before setting any property on the Layout property page.
STATUS
This behavior is by design.
Keywords: kbdatabinding kbprb kbctrl KB193094