Datagrid SortProperty not sorting asc

Radzen.Blazor Version: 4.32.11

I have an Age column that is a string (i.e. "5 Days") which is a computed property based on the DateCreated field in the database.

I added a SortProperty to the Age column in the datagrid and set it to "DateCreated", which works as expected when I click the column name, except when I click the name a second time to reverse the sort, it stays sorted the same.

Looking at the Odata query, for sorting the first time, the request looks like this:
"$top=25&$skip=0&$orderby=DateCreated desc&$count=true"
but when sorting the second time (reverse) the request looks the same:
"$top=25&$skip=0&$orderby=DateCreated desc&$count=true"
when it should say 'asc'.

Is this a bug, or do I need to specify the different sort options somewhere?

This is exactly reverse sort OData expression.

So then the forward sort isn't working, since forwards and backwards are both producing the same odata expression.

Let us know how to replicate the problem. You can use our demos - they are editable and there are also OData examples.

Steps to reproduce:

On the datagrid demo: Blazor DataGrid Component - OData Service | Free UI Components by Radzen

Add SortProperty="@nameof(Employee.FirstName)" to the Title column:

Then Run and go to the UI, and click the Title column to sort it. The grid is sorted by First Name descending:

Now click the Title column again to reverse the sort. The First Name column does not sort ascending:
image

@enchev any update on this?

I was able to replicate the problem and we will do our best to include fix in our next update early next week.

1 Like

Awesome, thanks! Will this update be included in version 4.32?