开发者

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 DataPropertyNames of the existing columns to match the properties of the objects in the array.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜