Dear all,
I have the column (Datatype=system.string) in ultragrid. It is showing NA or decimal.
Actually the data is decimal (I have changed the value zero to be NA when showing in the grid. 0==> NA). But the sorting does not apply to decimal due to the datatype is string. The sorting is like below:
" 1 , 11, 2, 23, 3, 333, 4, NA " in ascending order. How can I make sorting in decimal with NA ==0 but the showing in the grid is "NA"? Is it possible??
Mike: "This is not a Comparer that you could possibly be assigning as a SortComparer on a grid column - it would just blow up when the grid tried to pass a couple of UltraGridCell objects into it".
Dear Mike,
Could you show me the link or any sample code that are useful in my case??
In my attached file,( forms scripts), I debug it and checked that the return values of this.catlist.sort(....).They are correct. I am afraid that there is a collision between mouseclick event and default behavior of ultragrid.
Would that happen??
Hi,
I'm afraid I am lost. I can see that the screens shots you attached here are showing that the sorting is not working the second time.
But I don't know what you are doing in your code. The only IComparer in the three cs files you attached here is a Comparer for a specific type of object. This is not a Comparer that you could possibly be assigning as a SortComparer on a grid column - it would just blow up when the grid tried to pass a couple of UltraGridCell objects into it.
If the grid is sorting the data by text, then the column's DataType must be a string. The grid does not change the DataType from a numeric type (or any type) into a string.
One thing I did notice that is wrong is that your Comparer is reversing the return value based on the SortOrder. You should not be doing that - or at least it's not something you should do when sorting in the grid.
I am trying to use option 2.
But I don't know why the readonly field in ultragrid is always changed from decimal datatype to string datatype. Then the sorting is in string format. Do you know why?? How to overcome this??
Reattached the zip file in general format.
There is a forms script in brief.
Please help!!