Hi,
I'm trying to bind the tree list to a list of Dictionary<string. object> objects, where the TreeListColumn.Field equals the key in the Dictionary for that row. This works fine for displaying the data in the tree. However, when I try to set the sorting state by specifying a column name to sort by, I get the following error inside Telerik:
Error: System.ArgumentException: Invalid property or field - 'Name' for type: DynamicEntityBase
at Telerik.DataSource.Expressions.MemberAccessTokenExtensions.CreateMemberAccessExpression(IMemberAccessToken token, Expression instance)
at Telerik.DataSource.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName)
at Telerik.DataSource.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName, Boolean liftMemberAccessToNull)
at Telerik.DataSource.Expressions.PropertyAccessExpressionBuilder.CreateMemberAccessExpression()
at Telerik.DataSource.Expressions.MemberAccessExpressionBuilderBase.CreateLambdaExpression()
at Telerik.DataSource.SortDescriptorCollectionExpressionBuilder.Sort()
at Telerik.DataSource.Extensions.QueryableExtensions.Sort(IQueryable source, IEnumerable`1 sortDescriptors)
at Telerik.Blazor.Data.TelerikTreeListDataSource`1.SortItems(IEnumerable`1 tree)
at Telerik.Blazor.Data.TelerikTreeListDataSource`1.SortItems(IEnumerable`1 tree)
at Telerik.Blazor.Data.TelerikTreeListDataSource`1.SortItems(IEnumerable`1 tree)
at Telerik.Blazor.Data.TelerikTreeListDataSource`1.SortItems(IEnumerable`1 tree)
at Telerik.Blazor.Data.TelerikTreeListDataSource`1.SortTree()
at Telerik.Blazor.Data.TelerikTreeListDataSource`1.InitData(IEnumerable`1 sourceData)
at Telerik.Blazor.Data.TelerikTreeListDataSource`1.ProcessData(IEnumerable data)
at Telerik.Blazor.Components.Common.DataBoundComponent`1.ProcessDataInternal()
at Telerik.Blazor.Components.Common.DataBoundComponent`1.OnParametersSetAsync()
at Telerik.Blazor.Components.TelerikTreeList`1.OnParametersSetAsync()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
Is there a work around for this, or can sorting by done by some other method? We want to use a Dictionary since we are dynamically creating the data to bind to instead of hard-coding a specific POCO for each page.