How To Bind Objects To DataGrid

  • Thread starter Thread starter Nicholas Paldino [.NET/C# MVP]
  • Start date Start date
N

Nicholas Paldino [.NET/C# MVP]

Yaniv,

You should have a collection implement the IBindingList interface. The
datagrid will recognize this interface and sign up to receive notifications
(through events on the interface) when the list has changed.

Also, if the properties are not read only (which they are not from your
code), you should have no problem clicking on the cell and modifying the
value.

Hope this helps.
 
Hello.



How can I bind a list of objects to a DataGird?

I have a custom collection of Customer class



class Customer {

Public String Name;

Public String Addres;

….

}



How do I bind the collection to a data grid and the data grid will provide
the options to add\modify\delete customers from the collection.



If I put the Customers in an ArrayList data grid only display the data and
I’m unable to edit it.





Any help will be appreciated.





Yaniv abo

(e-mail address removed)
 
Back
Top