By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,238 Members | 1,901 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,238 IT Pros & Developers. It's quick & easy.

Determine visible row # in winforms datagrid?

P: n/a
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.

Dec 23 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
Dec 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.