Get Viewing Row in DataGrid

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!
 
B

Brian Tkatch

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top