DataGridView lags for a second with large data updates

Posted by alexD on Stack Overflow See other posts from Stack Overflow or by alexD
Published on 2009-12-15T18:12:59Z Indexed on 2010/04/18 2:03 UTC
Read the original article Hit count: 338

Filed under:
|
|
|

I have a DataGridView with about 400 rows and 10 columns. When the user first displays this table, it receives all of the data from the server and populates the table. The DGV uses a DataTable as it's data source, and when updating the DataTable I use row.BeginEdit/EndEdit and acceptChanges, but when the View itself is updated it lags for a second while all of the DGV is being updated. I am wondering if there is a way to make this smooth, so that for example, if the user is scrolling through the data and it updates, it won't interrupt the scrolling. Or if the user is moving the display around the screen and it updates, it won't interrupt. Is there an easy way to do this? If not, is there away to prevent the DGV from updating the view until all events have ended so it won't be repainted until the user stops scrolling, dragging, etc ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about datagridview