BUG: DBGrid Loses All Except One Row After Scrolling to BottomLast reviewed: November 11, 1997Article ID: Q176563 |
The information in this article applies to:
SYMPTOMSWith a bound DBGrid control, navigation is often performed with the properties and methods of the Recordset object of the Data control. After such an operation, if the vertical scroll bar of the DBGrid control is dragged to the bottom, the DBGrid control loses all except the last row of data. In addition, the vertical scroll bar is lost, making it impossible to view the rest of the rows.
RESOLUTIONTo work around this problem, place the code to ReBind the data in the RowColChange event of the DBGrid control, as follows:
Private Sub DBGrid1_RowColChange(LastRow As Variant, _ ByVal LastCol As Integer) If DBGrid1.VisibleRows = 1 Then DBGrid1.ReBind DBGrid1.Scroll 0, Data1.Recordset.RecordCount - _ Data1.Recordset.AbsolutePosition End If End Sub STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThere are several properties and methods of the Recordset object that can be used to navigate through the rows of a bound DBGrid control. The properties include:
AbsolutePosition PercentPositionThe methods include:
FindFirst Move SeekFor the following illustration, the AbolutePosition property is used.
Steps to Reproduce Behavior
Keywords : vb5all VBKBAX VBKBComp VBKBCtrl VBKBDB VBKBStd Version : WINDOWS:5.0 Platform : WINDOWS Issue type : kbbug |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |