GridView: Searching, Sorting, Filtering does not work properly when column is bound to a nested property of a dynamic property value
Posted on:11 Oct 2021 11:57
The architecture of RadGridView's data layer uses Queryable for all data operations: sorting, filtering, grouping, and searching. When this data layer creates the expression tree to represent a data operation containing dynamic objects we get the following error: "error CS1963: An expression tree may not contain a dynamic operation". And by "dynamic operation" here one should understand any operation between two instances as well as any access to members of the instance e.g. properties, methods.
Here is a quote from Eric Lippert on the matter "The codegen that we generate for those dynamic operations at compile time that implements dynamic semantics at runtime is exceedingly complex; sufficiently complex that there is no easy way to represent it cleanly in an expression tree. Basically, the choice came down to "don't allow them in expression trees", or "ship late", or "ship buggy". We chose the former."
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.