jana
asked on
How to set the row selection as it was prior leaving the datagrid in vb6
We have a form that has a datagrid. When the user double-clicks on the desired row, the apps open secondary form to work with. We hold the row the user double-clicked on:
When the secondary form is finish, the control returns to the main form's datagrid.
Since the secondary form manipulates the data via SQL that is being displayed in the main form's datagrid, we refresh it prior prior user returns to it:
When all is done, we use this line to place the control in the row of the main's datagrid as it was when the user double-clicked on it:
But it doesn't work. The control always returns to the top of the main datagrid display.
Please advice on how to set the control to the row prior the user left it.
Private Sub grdDataGrid_DblClick()
HoldDatagridRow = grdDataGrid.Row
'instructions
'instructions
'instructions
End Sub
When the secondary form is finish, the control returns to the main form's datagrid.
Since the secondary form manipulates the data via SQL that is being displayed in the main form's datagrid, we refresh it prior prior user returns to it:
frmForm1.Refresh
frmForm1.grdDataGrid.Refresh
frmForm1.dcAdodcConnect.Refresh
When all is done, we use this line to place the control in the row of the main's datagrid as it was when the user double-clicked on it:
grdDataGrid.Col = HoldDatagridRow
But it doesn't work. The control always returns to the top of the main datagrid display.
Please advice on how to set the control to the row prior the user left it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes! Worked!
ASKER