Hello Syncfusion,
Here there is my situation, I have one SfDataGrid bind to a GridViewModel class (who is generic <T>) who set an ObsvervableCollection binded to his ItemCollection.
For one model object I need to add N-columns in terms of his related childs.
Here there is how I tried to do it, I parsed my collection, and for each related child, I create a dynamic object with ExpandoObject. When parse is done, I add it to an ObsvervableCollection who is copied in the binded ItemCollection.
Like this :
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var result = await this.Service.GetLstRemoteTAsync(userId);
var s = new ObservableCollection<object>();
foreach (var benefit in (IEnumerable<Benefit>)result)
{
dynamic service = new ExpandoObject();
service.Contexts = string.Join(", ", benefit.Contexts);
service.Code = benefit.Code;
service.BarCode = benefit.BarCode;
service.Vat = 0.0;
service.SubFamily = benefit.SubFamily;
foreach (var modifier in benefit.Modifiers)
{
ExpandoHelper.AddProperty(
service,
"Modifier" + benefit.Modifiers.IndexOf(modifier),
modifier);
}
s.Add(service)
}
this.Items = s;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
However, when it comes to generate column, the base objects displays correctly but when he arrives to complex objects he doesnt go through the method (AutoGeneratedColumn).
How can I do for display these columns ?
Thx, Alex.