PC Review


Reply
Thread Tools Rate Thread

Determine visible row # in winforms datagrid?

 
 
xlar54
Guest
Posts: n/a
 
      23rd Dec 2006
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.

 
Reply With Quote
 
 
 
 
xlar54
Guest
Posts: n/a
 
      23rd Dec 2006
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.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determine previously focused control in winforms adiel_g@hotmail.com Microsoft Dot NET Framework Forms 3 26th Oct 2007 11:15 PM
WinForms DataGrid Pietje de kort Microsoft C# .NET 0 12th Nov 2003 08:57 AM
how to determine winforms of webapp ? Jurjen de Groot Microsoft Dot NET Framework Forms 1 16th Sep 2003 07:46 PM
how to determine winforms of webapp ? Jurjen de Groot Microsoft ASP .NET 0 16th Sep 2003 03:55 PM
Can the WinForms DataGrid be used without ADO.Net? Dave Veeneman Microsoft C# .NET 3 13th Aug 2003 08:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:48 AM.