Custom sort on datagrid

Hello

In order to correctly sorting by a special column an IComparer had to be applied for sorting alphanumerical data:

The underlying data is sorted correctly however on GUI not the desired output is shown (paging enabled multisort disabled, doesn't matter if event handled in OnActionBegin/Complate handler - no effect)

desired output:

P3-A1,P3-A2,P3-A3...P3-A10,P3-A11,P3-B1....P3-B10,P3-B11.....

on GUI(incorrect): seen in ASC order


Could you write ideas how to see the ordered data correctly?







3 Replies 1 reply marked as answer

GE Gergo September 10, 2021 07:35 AM UTC

Hello Again

As per another similar problem raised I suppose I have to apply a custom data adaptor like so in the grid:

Can anyone confirm it is the way to go or is there an easier solution?


Snippet
<SfDataManager AdaptorInstance="@typeof(CustomAdaptor)" Adaptor="Adaptors.CustomAdaptor"></SfDataManager>


Marked as answer

GE Gergo September 10, 2021 11:33 AM UTC

A custom adaptor should be applied with the custom sorting algorithm in place. This way it works



RS Renjith Singh Rajendran Syncfusion Team September 13, 2021 05:21 AM UTC

Hi Gergo, 

Greetings from Syncfusion support. 

We are glad to hear that you have achieved your requirement using CustomAdaptor. Please get back to us if you need further assistance. 

Regards, 
Renjith R 


Loader.
Up arrow icon