We are trying to display some records from a database. Some of these values are numeric. We want the user to be able to sort these records so we have the sortascendingbutton and sortdescendingbutton visible. When the user sorts by the numeric columns, the values are treated as text, for example 1,5,15,122 would be sorted as 1,122,15,5 and the values are left justified.
As a temporary solution, we put leading zeros in, so our values would now be 001, 005, 015, 122 which solved the sorting problem, but looks a bit silly. In addition, clearly this will fail if there is a number greater than 999.
I have just put a few leading spaces in front of the numbers which looks better. As I know what my maximum value can be, all I need to do is put the correct number of leading spaces in.
For example, if the max value is 9999999 then my numbers will look like this: ______1, ______5, _____15, ____122 (where _ = space).
This is a better solution, but if anyone can suggest a grid which can deal with different datatypes that would be useful.