Constantly Updating List ... DataGridView or ListView

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

Guest

Hi All,

I want to bind a datagridview or ListView to a List that is constantly
being updated (items are added/removed all the time).

Any ideas what the best way is to do this? I tried binding the collection
directly to the grid but occasionally I'll get cross thread errors
(different threads updating the collection).

Is there a way to get a live view of an array/list easily?

Thanks!
 
Hi All,

I want to bind a datagridview or ListView to a List that is constantly
being updated (items are added/removed all the time).

Any ideas what the best way is to do this? I tried binding the collection
directly to the grid but occasionally I'll get cross thread errors
(different threads updating the collection).

Is there a way to get a live view of an array/list easily?

Thanks!

I've never done it but I understand that you can overload a method in
a .NET class. So you should be able to write your own .Add method for
the List. In your .Add method, invoke the standard.Add method to add
the item, and then re-populate the form control(s).
 
(e-mail address removed) wrote in 50g2000hsm.googlegroups.com:
I've never done it but I understand that you can overload a method in
a .NET class. So you should be able to write your own .Add method for
the List. In your .Add method, invoke the standard.Add method to add
the item, and then re-populate the form control(s).

Yes, but if the .add is called from a different thread, you'll get a cross
thread error.

Also I don't have access to the DataGridView from inside the collection.
 
Back
Top