Grid reorder rows issues if sort is enabled

1 Answer 141 Views
Grid
Asad
Top achievements
Rank 1
Iron
Asad asked on 17 May 2022, 06:58 PM

Hi there

I have a grid with draggable functionality but if I enable the default sort the drag & drop won't work any more.

 

I'm setting the default sort in jquery:

grid.dataSource.sort({ field: "Id", dir: "asc" });

 

I've tried to do it in C# code but got the same results.

 

Can anyone help me with it ?

 

Thanks

Asad
Top achievements
Rank 1
Iron
commented on 18 May 2022, 12:28 AM

I was able to solve the issue by ordering the records on database level, which I was trying to avoid. But, it's better than nothing at all.

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 20 May 2022, 02:02 PM

Hello Asad,

I am glad you have found a away to resolve the encountered issue, because this use case is a known limitation of the Grid's Drag and Drop functionality:

dataSource operations (for example, sorting, filtering, grouping, and so on) that involve rendering rows in a different order than their natural one are not supported.

Please don't hesitate to contact us, if more questions occur.

Regards,
Stoyan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Asad
Top achievements
Rank 1
Iron
Answers by
Stoyan
Telerik team
Share this question
or