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

Issues Sorting Numerically In Grid

I'm having issues with the sorting settings in the grid. we have an "Engine ID" column that ranges in numbers from 1 to 999999. Right now when we sort this column, it will only sort them according to the first value of the number—for example, if we sort them backwards it could look something like: 

Engine ID
945
70324
602
434345
2
10005

This is incredibly lame, so I need to know how to sort numerically according to the full number, not just the first value of the number.

Thanks!



Attachment: sortingscreenshots_54a4915.zip

3 Replies

RU Ragavee U S Syncfusion Team October 17, 2014 12:53 PM UTC

Hi Mark

 

We have analyzed the reported query and we suspect that you have passed the values to the ENGINE ID column as string type and thus the sorting is performed based on the string values.

 

So we suggest you to bind the values to the column with type as integer in order to avoid the mentioned issue.

 

Please let us know if you have any queries.

 

Thanks and Regards,

Ragavee U S



MW Mark Wells October 20, 2014 03:02 PM UTC

Could you provide links to some examples?


RU Ragavee U S Syncfusion Team October 21, 2014 11:41 AM UTC

Hi Mark

 

Based on your requirement, we have created a simple sample and the same can be downloaded from the below location.

 

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/JS_Sample_12.2.0.361459213197.zip

 

In the above sample, we have passed values to the ID column as integer and NAME column as string. Please see the below snippet.

 

var Data = [];

        for (var i = 0; i < 100000; i += 1) {

            Data.push({ "ID": i, "Name": "column[1]" + "[" + i + "]", "City": "column[2]" + "[" + i + "]" });

        }       

 

For your kind information, from your query we have understood that you have requested for a sample to bind integer columns to dataSource. So we have provided a sample on the same.

 

Please get back to us if we have misunderstood your requirement by providing more information which will be helpful for us to provide response accordingly.

 

Please let us know if you have any concern.

 

Regards

Ragavee U S


Loader.
Live Chat Icon For mobile
Up arrow icon