Databinding an IEnumerable type to DataGrid?

C

cody

What do I have to do if I want to Databind an IEnumerable to a Datagrid?
I have a datagridtablestyle in the datagrid but I don't know what the
MappingName should be. For the DatagridBoolColumns I've set the mappingnames
to the properties of the class which the IEnumerable class yields.

myDataGrid.DataSource = myEnumerable;
myDataGrid.Refresh();

If I open the Form the grid is still empty. Additionally GetEnumerator() of
my class is not called.
 
C

cody

I only implemented IEnumerable because I just wanted readonly view.
I now changed it this way that I inherit from ArrayList and now it works :)
There is still a lot to learn about databinding and I find Databinding one
of the most complicated things in .NET.
 

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