Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
790
Dynamic columns
posted

Hello,

I am writing my application in MVVM pattern.

I have a IEnumerable of ViewModels

each ViewModel has 4 properties- operator, field, value and RowID

I want the DataGrid to display the ViewModels so field is the column name. Value is the cell value under this field and operator is different column . So for all ViewModels that have same RowID , These ViewModels will be in same row in DataGrid. And so on. Also if Two ViewModels have same RowID but different Operator, than DataGrid will contain two operator columns. 

How can i do it?

I tried to work with Dependency property but it's problematic since the DataGrid can be editable.