DataGridView Problem

I recently started using ADO.NET with VB/C# .NET and I'm really liking it.

I also recently ran into a problem with the DataGridView control.  I added a DGV Control to my Windows Forms application and bound it to a DataSource.  Now it's working great and everything but anytime it has enough rows to warrent the use of the Vertical Scroll bar it locks up my Apps UI for some reason.  I can't for the life of me figure this one out.  If anyone has any suggestions/comments please post them.

Thanks!

-Chad




Answer this question

DataGridView Problem

  • RonInOttawa

    Yes, I apologize that I forgot to reply here again, but with a little help from Xtek I got everything fixed up. Just set up a delegate to add new rows to my DataTable from the original thread. Thanks :)

  • Craigster

    Figured it out-- it was becuase I was calling the sub that was adding this information into the DB was on another thread.

    -Chad



  • SIDVIRGOSTER

    So... does anyone else have any more information about this Why does having it on another thread cause a problem I have the same issue as you, and I as well am adding rows through another thread, but I can't simply toss it all into one thread to solve the problem. Is there another solution to this

  • MSFT Abel Valadez

    You cannot interact with a bound datasource through anything other that the UI thread. This is the way that databinding is coded. Your only real option is to use some type of cross-thread communication (static variables or messaging) to communicate from the background thread to the UI thread that something needs to happen.
  • DataGridView Problem