We recently upgraded to version 17.2 and are now experiencing issues on our grids. After you save the layout as XML and load it, our columns that are URLs and contain numbers are not sorting correctly. They are sorting as if they are strings. Is there something I need to change in the code?
Thank you.
Hello,
This sounds like the default behavior for the grid. How was it sorting before, and does the behavior go back if you revert to the older version? If this is the case, then it's possible there might be a bug so I will have some followup questions to check into that.
My recommendation for this is to implement a custom sort. You can do that by assigning a class that implements the IComparer interface to the column's SortComparer property. You can implement the Compare method on the IComparer class to define the custom sort behavior.
The column was sorting them in order as numbers. For example, if you put the column in ascending order it would show
1098
109666
123456
Now after we save our layout and sort the column it shows.
Also, it seems to only be an issue on columns that have column style as URL.
The grid's sorting is based on the DataType of the column So if your column contains strings, they will always be sorted as strings. It has always worked that way and that has not changed in any version. At least not intentionally. And I don't think the Column Style would have any effect.I also can't see any reason why saving and loading a layout would have any effect.
But if you can create a sample where it sorted correctly in some older version and no longer sorts the same way in 17.2 then we could definitely look into it and see if this behavior changed and why and possibly correct it.