svlada
svlada

Reputation: 3288

C# Datagrid multiple columns to one column

I am using datagrid control to represent some data. I want to show values from multiple columns in one cell. How to achieve that? Currently my datagrid is binded to List. List elements implements INotifyPropertyChanged interface, and each property of individual objects represents column in datagrid.

Upvotes: 1

Views: 1023

Answers (1)

Jahan Zinedine
Jahan Zinedine

Reputation: 14864

you can project the list to a new list satisfying this constraint, or change the query that returns data,

var newList= list.Select(o=> new {newProp = o.prop1 + ' ' + o.prop2});

Upvotes: 2

Related Questions