This column causes error when I try to sort or filter. I am not using datagrid "LoadData", so all data is loaded once on initialization and passed to the datagrid component. All sorting and filtering is client side. Weirdly, the error goes away if I change the property name in RdtoLocation from Parent to something else.
This is the error message I get in the browser:
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: No 'parent' is in scope
No 'parent' is in scope (at index 0)
Worth mentioning that some entries in the column may be null or empty strings.
@enchev Sorry for the late reply. I have attached a demo. It is a Blazor hosted project in a zip. You can login with a@b.c and password Abcd@1234 or you can register a new dummy user.
The Location entity is self-referencing / hierarchical. I cannot sort or filter using the field named "Parent" but the same server-side field, if mapped to a DTO field called "NotNamedParent" works okay.
Debugging customers projects is part of our paid services - you can check our pricing page for reference. If you want to receive quick help you might need to provide a simplified version of your code (a self contained code snippet with just the DataGrid) that can be executed easily. Other possibility is to attach the source code of Radzen.Blazor to your project to debug your entire application.
public class RdtoLocation
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public int? ParentId { get; set; }
public string Parent { get; set; } = string.Empty;
public int? NotNamedParentId { get; set; }
public string NotNamedParent { get; set; } = string.Empty;
public IEnumerable<RdtoLocation> Children { get; set; } = new HashSet<RdtoLocation>();
}
Both Parent and NotNamedParent are derived using Automapper from the database entity as follows:
Datagrid works fine in case of server side sorting and filtering but causes error when using the built-in client side sorting and filtering with column named Parent.