C
C#3y 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)
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
1 Reply
Kukuba008
Kukuba008OP3y ago
solved it, I ended up inserting single rows and edited the cells and manually set the values
Want results from more Discord servers?
Add your server