Link to home
Start Free TrialLog in
Avatar of lambch0p
lambch0pFlag for Afghanistan

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
Avatar of dungla
dungla
Flag of Viet Nam image

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
Avatar of lambch0p
lambch0p
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lambch0p

ASKER

Using the datatemplate method allows for arbitrary content to be displayed