© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Datagridview
C#CC# / help
11mo ago
✅ Deserializing nested array json file.
C#CC# / help
2y ago
❔ DataGridView Issue
C#CC# / help
3y ago
❔ DataGridView Buttons
C#CC# / help
4y ago