# Persist sort in datagrid

**URL:** <https://forum.radzen.com/t/persist-sort-in-datagrid/10341>\
**Category:** Radzen.Blazor Components\
**Created:** [March 15, 2022, 9:20am UTC](https://forum.radzen.com/t/persist-sort-in-datagrid/10341 "2022-03-15T09:20:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oliver\_B](https://forum.radzen.com/user_avatar/forum.radzen.com/oliver_b/32/9212_2.png) [@Oliver\_B](https://forum.radzen.com/u/Oliver_B)\
**Post date:** [March 15, 2022, 9:20am UTC](https://forum.radzen.com/t/persist-sort-in-datagrid/10341/1 "2022-03-15T09:20:42Z")

</div>

I have a DataGrid where most columns are sortable.  
When the user leaves the page, I want to capture how the grid is currently being sorted by, ie. a value like "{propertyName} desc".  
How do I get that? It doesn't seem like its a value that is available, but can I override the sorting to keep track of it myself?  
Additionally, i will need to set the sort again. I could order the data before i load it, but can this be done on the grid itself?

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [March 16, 2022, 6:51am UTC](https://forum.radzen.com/t/persist-sort-in-datagrid/10341/2 "2022-03-16T06:51:14Z")

</div>

You can use LoadData to get info about sorting, filtering, paging, etc.:

> **[Blazor DataGrid - LoadData Event | Free UI Components by Radzen](https://blazor.radzen.com/datagrid-loaddata)**
>
> Blazor Data Grid custom data-binding via the LoadData event.

There are examples how set sorting and filter when the grid is loaded for the first time:  
[https://blazor.radzen.com/datagrid-sort-api](https://blazor.radzen.com/datagrid-sort-api)  
[https://blazor.radzen.com/datagrid-filter-api](https://blazor.radzen.com/datagrid-filter-api)
