How reflect the changes in array to bound grid

L

Latha

I have bound a array of objects to datagridview in vb.net. If I add new
objects to array, that doesn't reflect in datagridview. What I have to do?

Thanks,
Latha.P
 
J

Jack Jackson

I have bound a array of objects to datagridview in vb.net. If I add new
objects to array, that doesn't reflect in datagridview. What I have to do?

Use BindingList(Of T) instead of an array. It implements a lot of
binding related events.

If you want changes to the objects in the list to be reflected in the
bound controls, the objects in the list need to implement
INotifyPropertyChanged. See
<http://msdn2.microsoft.com/en-us/library/ms229614.aspx> for an
example.
 

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

Top