Binding xceed datagrid to list<list<ViewModel>>

320 Views Asked by At

I need to create a row inside the xceed datagrid where all row fields will be created dynamically because their types, names, amount are available only in runtime. I tried ObservableCollection of object[] where object[] is an array of system types(int, string) and it works well but I want to have an array of view models or better list of viewmodels. Is this possible to do? Thanks.

1

There are 1 best solutions below

0
OmegaDoom On BEST ANSWER

Turned out that wpf allows to bind to a property of a property. And path even can contain array or list index. The column FieldName property must be "[i].Value" where i is an index of view model inside the nested list and "Value" is the property name of view model.