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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Column sorting

Thread ID:





120307 Sep 18,2015 07:35 PM UTC Sep 24,2015 09:42 AM UTC JavaScript 5
Tags: ejTreeGrid
Rafael Delanhese
Asked On September 18, 2015 07:35 PM UTC


While using  Treegrid combined with ejDatamanager pulling data from a WCF Data Service (OData Protocol) I'm having problems when sorting numeric columns. Seems like that the control is sorting data as if it was a string and not a number.

Is there any way to change this behavior?

Attachment: SyncFusionTreeGridWithODataExample_c860f840.zip

Mahalakshmi Karthikeyan [Syncfusion]
Replied On September 21, 2015 04:29 PM UTC

Hi Rafael,

Sorry about the inconvenience caused.

We have facing some issue while using decimal data type values passed by the ej.DataManager to TreeGrid control. So at present we recommend you to use the float data type for the variable “LimitAmount1M”. Please refer the below code example for details.


namespace SyncFusionTreeGridExample.Service



    public class Facility


        public String LocalFacilityId { get; set; }

        public float LimitAmount1M { get; set; }



We have also modified your sample and you can find the sample under the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/120307/ze/SyncFusionTreeGridWithODataExample-691741768


Mahalakshmi K.

Rafael Delanhese
Replied On September 21, 2015 07:29 PM UTC

I'm afraid that I couldn't change my data type from decimal to float. 

My sample was a simplification of my real case scenario. In my real scenario the decimal field come from a EDM mapping of a money column in a sql server database, and the type money can not be mapped to a float type in C#.

Is there any prevision of when the issue will be resolved?

Mahalakshmi Karthikeyan [Syncfusion]
Replied On September 22, 2015 01:41 PM UTC

Hi Rafael,

Sorry about the inconvenience caused.

This is due to the default behavior of the OData Serialization in which decimal/int64 literal will be converted to string. Please refer to the below link.


OData v2/v3 don’t have support to handle this (OData V4 has support) and hence to resolve this we can use the custom adaptor as follows.

$(document).ready(function() {

            var moneyHandleAdaptor = new ej.ODataAdaptor().extend({

                processResponse: function (data, ds, query, xhr, request, changes) {

                    var data = this.base.processResponse.call(this, data, ds, query, xhr, request, changes);

                    var str = JSON.stringify(data.result ? data.result : data);

                    data = JSON.parse(str, function (key, val) {

                        if (key == "LimitAmount1M")

                            val = parseFloat(val);

                        return val;


                    return data;



            var dataManager = ej.DataManager({ url: "/Service/DataService.svc/Facility", adaptor: new moneyHandleAdaptor() });



We have also modified your sample according to your requirement. You can find the sample under the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/120307/ze/SyncFusionTreeGridWithODataExample1514505379


Mahalakshmi K.

Rafael Delanhese
Replied On September 23, 2015 04:43 PM UTC

Now it work's.


John Rajaram [Syncfusion]
Replied On September 24, 2015 09:42 AM UTC

Hi Rafael,

Thanks for the update.

Please let us know if you require further assistance on this.


John R


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon