Ah found my own answer:
int firstVisibleRow =
dataGrid1.HitTest(dataGrid1.PreferredRowHeight+10,dataGrid1.RowHeaderWidth+10).Row;
int lastVisibleRow = firstVisibleRow + dataGrid1.VisibleRowCount;
xlar54 wrote:
> How can I tell which rows are visible in a datagrid (winforms app)? I
> have alot of data in the grid (bound to a datatable), and I need to
> refresh that data frequently. (theres no easy way to know what data
> has changed), so Im looking at just updating the visible portion of the
> grid if this is possible.
|