Windows DataGrid

Just to add...

Datasource of a grid can either be a collection...
You can create a class, put some properties in it (note that only properties will appear as columns), and then instanciate a collection os that class and there you go...

Alex :p
 
Thanks but it is a little late, i worked out a similar way to what AlexCode said. I created a class and is an IList (ArrayList). Then i set the datasource to the ArrayList.

I still have a problem though. When you have a class the columns are in order from A-Z because they are properties. I haven't been able to find information on using DataGridTableStyle which i think your are meant to use.

I am also trying to delete an item from the list. I have tried
DatGrid1.DataBindings.RemoveAt(index)
but it doesn't have any items. Currently i am unbinding the DataGrid, removing the item and rebinding.

Please help
 
Back
Top