I have a model with a nested ExpandoObject for dynamically added attributes (code is shorten for brevity)
public class WorkOrder
{
public string CustomerName { get; set; }
public string CustomerNumber { get; set; }
public ExpandoObject ItemCategories { get; set; }
}
I can display ItemCategories by using the complex binding as such:
<GridColumn HeaderText="@column.Caption"
Field="ItemCategories.Inventory"
AllowFiltering="true"
AllowSorting="true"
Format="@column.Format">
</GridColumn>
This works great but sorting on this column does not work and Filtering I get the following error:
Uncaught Error: System.Collections.Generic.KeyNotFoundException: The specified key 'Inventory' does not exist in the ExpandoObject.
How can I enable filtering on nested complex ExpandoObject? T
I am using .NET 5.0 is this compatible with that version? Thanks
I noticed that if I create the ExpandoObject directly and I declare the properties directly like you guys did like this
ItemCategories.Inventory = "Lorem Ipsum"
it works great, however, this data comes from an API, the idea is that client should adapt if in the future an Item has new categories, so I am not sure if this has somethign to do with how System.Net.Http.Json deserializes the ExpandoObject. Any suggestions are appreciated