Sort order customization
Sort order customization
gabricalli
Posts: 1Questions: 1Answers: 0
Hi all,
I have a DataTable with a string column. In this column there are values like these:
RB289/C, RB289/BL/M, RB289/BL/S, RB289/BL/L, RB289/BL/XL and RB289/BL/XXL etc.etc
Since "RB289/C" is the code father, I'd like it was the first of the list, but it isn't.
In fact, the ordered table is as follows: RB289/BL/L, RB289/BL/M, RB289/BL/S, RB289/BL/XL, RB289/BL/XXL and in the end RB289/C !!!
Can you help me solve this 'problem'?
This discussion has been closed.
Answers
The column order is correct ... B..., C.
I guess You'll need some custom selected column that will trim the slashes (and other non-alphanumeric chars) and will count the string length first and only after ordering on this column, use the second column to order alphabetically.