We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid sort columns regardless of case

Using the grid sorting; it appears to sort by capitol letters first followed by lower case. 

current behavior-
first name:
Anne
Carl
bob
max

expected behavior-
first name:
Anne
bob
Carl

max

I've tried adding this to my page, but it doesn't seem to work
<script type="text/javascript">

        ej.support.enableLocalizedSort = false;
</script>

 I have the same issue with the PivotGrid.

Thanks for the help


2 Replies

PS Pon Selva Jeganathan Syncfusion Team January 12, 2023 04:53 PM UTC


Hi Paul,


Query: it appears to sort by capital letters first followed by lower case.


For Grid:


Based on your query, we understand that you are facing issues with the grid sorting by capital letters first followed by lower case letters. To avoid this issue, we suggest you seenableLocalizedSort API as ‘true’


And we have already discussed a same for this in our Knowledge Base documentation. Please refer to the below KB documentation, it will help you to enable non-case-sensitive grid sorting.


Please refer to the below KB documentation,

https://www.syncfusion.com/kb/2978/how-to-enable-non-case-sensitive-grid-sorting


For Pivot Grid:


We are currently validating this issue using Pivot Grid, and we will update you shortly with the solution.


Regards,

Pon selva





PS Pon Selva Jeganathan Syncfusion Team January 16, 2023 10:46 AM UTC

Paul,


Query: it appears to sort by capital letters first followed by lower case.


For Pivot Grid:


The sorting will be performed based on ASCII values, so the capital letter will be sorted first, followed by the small letter. This is how sorting works by default. However, we recommend you set the enableLocalizedSort property to true to override the default behavior. Please see the example code below.


Code Example:

<script type="text/javascript">   

       function onLoad(args) {

         ej.support.enableLocalizedSort = true;

}

</script>


Meanwhile, we have prepared a sample for your reference.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SyncfusionASPNETApplication1-1495018012


Output screenshot:



If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly


Loader.
Up arrow icon