devxlogo

Retrieving Data From a Datagrid Row That Isn’t Current

Retrieving Data From a Datagrid Row That Isn’t Current

When you change the row in the data control that a Sheridan DataGridis bound to, the DataGrid will also reposition its current row. To avoidthis, use the Clone method to make a copy of the dynaset in the data control.Then, accessing the rows in the cloned dynaset will not affect the currentrow in the DataGrid. Here’s an example:

 Dim DynClone As Dynaset Set DynClone = Data1.Recordset.Clone() 'clone the data control's dynaset DynClone.MoveFirst Do While Not DynClone.EOF() ...perform operation on the current _ row of DynClone... DynClone.MoveNext Loop 

devx-admin

Share the Post: