Windows Forms: DataGridView Binding Question
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?
You need to set the DataPropertyName
s of the existing columns to match the properties of the objects in the array.
精彩评论