views:

18

answers:

1

I have a Winform DataGridView, which has a number of predefined columns. Now I have an array of objects (the object structure conforms to the defined gridview columns) and I want to bind the gridview to this array (with gridview.datasource = array)

The problem is now, that I get several new columns in the grid after the predefined columns (the predefinded columns remain empty). How can I achive, that the array data is loaded into the predefined columns?

+1  A: 

You need to set the DataPropertyNames of the existing columns to match the properties of the objects in the array.

SLaks