# How to remove gird's column sorting through code when reload the gird?

**URL:** <https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054>\
**Category:** Blazor WebAssembly\
**Created:** [June 3, 2021, 1:12pm UTC](https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054 "2021-06-03T13:12:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shlok](https://forum.radzen.com/user_avatar/forum.radzen.com/shlok/32/7344_2.png) [@Shlok](https://forum.radzen.com/u/Shlok)\
**Post date:** [June 3, 2021, 1:12pm UTC](https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054/1 "2021-06-03T13:12:52Z")

</div>

Hello Radzen Team,

I am using Radzen 3.3.1 and RadzenDataGrid, very first the data is loaded in the grid through the LoadData event, and if I apply to sort on any column and then intensionally I wanna reload my grid, I just used gird.Reset() to remove filters and then grid.Reload(). It calls the LoadData event and gets the data successfully but the sorting arrow is still there on the grid and args.OrderBy also contains the same column's order value.  
Could you please help me with how to reset the sorting before reloading the grid?

Thanks,  
Shloke Ghenghat.

---

<div class="post-metadata">

**Author:** ![Shlok](https://forum.radzen.com/user_avatar/forum.radzen.com/shlok/32/7344_2.png) [@Shlok](https://forum.radzen.com/u/Shlok)\
**Post date:** [June 3, 2021, 2:04pm UTC](https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054/2 "2021-06-03T14:04:15Z")

</div>

Just like filters, Is this possible to reset the sorting?

Thanks!

---

<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:** [June 3, 2021, 2:11pm UTC](https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054/3 "2021-06-03T14:11:51Z")

</div>

You can set SortOrder property of the DataGrid columns to null.

---

<div class="post-metadata">

**Author:** ![Shlok](https://forum.radzen.com/user_avatar/forum.radzen.com/shlok/32/7344_2.png) [@Shlok](https://forum.radzen.com/u/Shlok)\
**Post date:** [June 3, 2021, 2:37pm UTC](https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054/4 "2021-06-03T14:37:53Z")

</div>

Hello @enchev,

Thank you so much for your quick response.  
Can you please suggest how to find SortOrder property through code on the .cs file?

I tried on the razor page but it doesn't reflect any change on the grid.

Thanks!

---

<div class="post-metadata">

**Author:** ![Shlok](https://forum.radzen.com/user_avatar/forum.radzen.com/shlok/32/7344_2.png) [@Shlok](https://forum.radzen.com/u/Shlok)\
**Post date:** [June 3, 2021, 2:52pm UTC](https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054/5 "2021-06-03T14:52:53Z")

</div>

Hello @enchev,

I got the property as grid.ColumnsCollection[0].SortOrder and before call grid.Reload() I set this to null, [0] as I was only tried to sort the first column, but this is not working.

---

<div class="post-metadata">

**Author:** ![Shlok](https://forum.radzen.com/user_avatar/forum.radzen.com/shlok/32/7344_2.png) [@Shlok](https://forum.radzen.com/u/Shlok)\
**Post date:** [June 4, 2021, 8:00am UTC](https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054/6 "2021-06-04T08:00:41Z")

</div>

Hello @enchev,

I also tried as below but it didn't work for me. Could you please review and suggest? Thanks

```
public async Task ReloadGrid()
{
        GridSorting(false);
        grid.Reset();
        await grid.Reload();
 }
private void GridSorting(bool isSort)
    {
        foreach(var col in grid.ColumnsCollection)
        {
            col.Sortable = isSort;
            if(!isSort)
                col.SortOrder = null;
        }
    }
protected async Task LoadData(LoadDataArgs args)
  {
        Console.Writeline(args.OrderBy); //always got value if filter is applied on the column
        ....//api calling
        ....
  }
```

---

<div class="post-metadata">

**Author:** ![Joro](https://forum.radzen.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@Joro](https://forum.radzen.com/u/Joro)\
**Post date:** [June 4, 2021, 9:08am UTC](https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054/7 "2021-06-04T09:08:13Z")

</div>

Hi, I also would like to add to the problems with " DataGrid Sort API" which is visible on the [demo page](https://blazor.radzen.com/datagrid-sort-api)... The initially set SortOrder property of the "First Name" column doesn't apply sorting on the data.

---

<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:** [June 4, 2021, 9:28am UTC](https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054/8 "2021-06-04T09:28:31Z")

</div>

We will do our best to provide fix for this with our next update.

---

<div class="post-metadata">

**Author:** ![Lee\_Runyan](https://forum.radzen.com/user_avatar/forum.radzen.com/lee_runyan/32/8936_2.png) [@Lee\_Runyan](https://forum.radzen.com/u/Lee_Runyan)\
**Post date:** [August 18, 2023, 4:35pm UTC](https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054/9 "2023-08-18T16:35:35Z")

</div>

Has this been fixed since June 21?

---

<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:** [August 18, 2023, 9:15pm UTC](https://forum.radzen.com/t/how-to-remove-girds-column-sorting-through-code-when-reload-the-gird/8054/10 "2023-08-18T21:15:00Z")

</div>

Yes, you can check the commits in the repo.
