Best way to populate this DataGridView
-
Happy new year... I have a list of objects I would like to use to populate a datagridview. I would somehow like to have each row bound to a specific object. I can see how that object class can be added as a datasource, but I'm not sure how to get the objects from my list added as a row. Anyone care to help? Also, is this the right direction? Thanks for your time.
-
Happy new year... I have a list of objects I would like to use to populate a datagridview. I would somehow like to have each row bound to a specific object. I can see how that object class can be added as a datasource, but I'm not sure how to get the objects from my list added as a row. Anyone care to help? Also, is this the right direction? Thanks for your time.
-
Happy new year... I have a list of objects I would like to use to populate a datagridview. I would somehow like to have each row bound to a specific object. I can see how that object class can be added as a datasource, but I'm not sure how to get the objects from my list added as a row. Anyone care to help? Also, is this the right direction? Thanks for your time.
-
After set the datasource, you must enumerate each row and set the row.Tag to your object.
Before the grid is populated, there are no rows to enumerate in the grid. If the class is used as a datasource, adding rows 'dgView.Rows.Add()' creates an exception stating 'Rows cannot be programmatically added to the DataGridView's row collection' I'm using the class as the view bindng source. If this is correct, how do I get the list of obects into the grid? If there is a different approach that would be better than what I'm attempting, please comment. Thank you for your time.
modified on Sunday, January 3, 2010 12:04 PM