C#C
C#4y ago
Kukuba008

Nested array in DataGridView

Hello, i want to display object in DataGridView (WinForms) that has an array of values (plus some normal properties) and each value should be assigned to new column, how can i do it ?
Example:
class:
string Name = "name" //some normal properties (easy to do normaly)
string[] items = new string[]  {"a", "b", "c"} //array of items (amount vary every time, but all object have same amount of items)


which turns into one line in grid
"name", "a", "b", "c"

I know how to dynamicaly create columns, but i don't know how to bind array to it. I would need something like:
column.DataPropertyName = "items[0]";
Thanks
Was this page helpful?