0
votes

When enabling the sort on kendo grid columns it will work as expected, except the case when the column being sorted contains negative numbers.

Is there any way to fix this problem ?

this is a screen-shot of my grid:

The column with the problem named "Incr"

3
sorry for late attention. If you still don't solve your problem , can you add code of grid and read function(or binding datasource) ?MustafaP

3 Answers

1
votes

Fixed: Sorting on negative numbers and zeros does not work as expected with Q3 2012 SP1

http://www.telerik.com/support/whats-new/kendo-ui-web/release-history/q3-2012-sp1-version-2012-3-1315

which version is your kendo ?

0
votes

You are not providing enough information for determining what might be wrong so I will have to work in hypothesis...

  1. The version that you mention works fine (I just tried it)
  2. Sorting might fail if column that contains negative "numbers" is not defined in the model and then KendoUI needs to infer the type of the data and might be guessing that they are strings. See this example http://jsfiddle.net/4aD6b/2/ where Value is defined as string and try sorting it. But if you define conveniently the model (see http://jsfiddle.net/4aD6b/3/) then it works perfectly well.

So, try defining the model as follow:

schema  : {
    model: {
        fields: {
            ...,
            Value    : { type: 'number' }
        }
    },

If this is not the case then update your post showing code and mostly how the data is sorted in your case.

0
votes

I got the same problem, found out that my model's property contains null and not number (during assignment from server side ajax), so I just change all null to 0 and sorting works enter image description here