How to prevent drawing DataGrid rows while adding rows?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a DataGrid with a DataTable as data source. At some point I fill the
DataGrid with rows, but I notice that for every row I add the DataGrid is
forced to repaint its contents.

How can I stop DataGrid from updating itself while I'm putting in a lot of
rows?

Thank you,
 
Try using SupendLayout and ResumeLayout, these functions avoid rendering.
(Remember to call ResumeLayout otherwise the control won't paint anymore)

cheers
Salva
 
Salvador,

Thanks, that did the trick :)

TT

Salvador said:
Try using SupendLayout and ResumeLayout, these functions avoid rendering.
(Remember to call ResumeLayout otherwise the control won't paint anymore)

cheers
Salva
 

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

Back
Top