lambch0p
asked on
C# WPF Bind a single GridViewColumn to a list of items
Hi,
I have a list of custom objects. One of the properties (called 'Names' for instance) in that object is a List<string> containing peoples names.
I want to bind my list of custom objects to the gridview, but would like the 'Names' column for each row to display all the names in the Names property (preferably formatted as comma separated).
I.E
DATE TOPIC NAMES
12/01/13 Cheese Bill, Mickey, Karen,John
14/03/13 Armadillos Arthur, Albert, Susan, Helen, Mark
I'm using MVVM, so any solution should take that into account.
Thanks
Mick
I have a list of custom objects. One of the properties (called 'Names' for instance) in that object is a List<string> containing peoples names.
I want to bind my list of custom objects to the gridview, but would like the 'Names' column for each row to display all the names in the Names property (preferably formatted as comma separated).
I.E
DATE TOPIC NAMES
12/01/13 Cheese Bill, Mickey, Karen,John
14/03/13 Armadillos Arthur, Albert, Susan, Helen, Mark
I'm using MVVM, so any solution should take that into account.
Thanks
Mick
I think you probably need to convert List<string> to string format by using string.Join() then display as a string for Names
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Using the datatemplate method allows for arbitrary content to be displayed