Get Viewing Row in DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Could someone let me know how to get the current top row in a datagrid that
is viewing by the user please?

I got a datagrid connected with a datatable with 5000 records. I can use the
CurrentCell to get the focus cell. However, when the user scroll to other
pages without clicking on a cell. I am unable to know where the user is
viewing.

Thanks in advance!
 
Jck said:
Could someone let me know how to get the current top row in a datagrid that
is viewing by the user please?

I got a datagrid connected with a datatable with 5000 records. I can use the
CurrentCell to get the focus cell. However, when the user scroll to other
pages without clicking on a cell. I am unable to know where the user is
viewing.

Thanks in advance!

I am not sure how this is done with DataGrids. For DataGridViews,
however, there is a property called FirstDisplayedCell.

This is just a guess. With DataGrid, if the currently selected row goes
off the visible area, the next control is selected. Reselecting the
DataGrid may select the first visible record of the DataGrid. Then,
between the selected row and the VisibileRowCount property, you may be
able to discern which rows are viewable.

B.
 
Back
Top