Radzen data grid row number column didn't sort properly after column sort. Any way to fix the row number after sorting by using client pagination?
Thank you.
Radzen data grid row number column didn't sort properly after column sort. Any way to fix the row number after sorting by using client pagination?
Thank you.
As far as I can see from your screenshot this column is bound to a property not an expression getting the index if the row.
I had similar issue when click the sort on column it crash. I had to reload. What mean bound to a property not an expression?
Thanks,
JianJing
After I code
<RadzenDataGridColumn TItem="IDictionary<string, object>" Title="@key"
Property="@GetColumnPropertyExpression(key, typeof(string))">
<Template Context="data">
@if ((data as IDictionary<string, object>).ContainsKey(key))
{
<span>@((data as IDictionary<string, object>)[key])</span>
}
</Template>
</RadzenDataGridColumn>
...
public string GetColumnPropertyExpression(string name, Type type)
{
var expression = $@"it[""{name}""].ToString()";
if (type == typeof(int))
{
return $"int.Parse({expression})";
}
else if (type == typeof(DateTime))
{
return $"DateTime.Parse({expression})";
}
return expression;
}
sort ok.