I have bound a column to a value list which gets its values from an enum.
I've parsed out the enum to add items into the list such as (dataValue, displayText) but when sorting I would like to sort by data value (an int, and in this case a priority value) and not by display text.
Is it possible to do this?
This simple solution works wonderfully Georgi! Thanks!
As for a SortComparer, I never did look at it but for something more complex, I'll keep it in mind for the future. Thanks Mike!
Hi,
May be I have other solution of your question by using Enum. Please look the attached example. There are tree columns :
- "Column A" sort data via display Text;
- "Column B" - show the internal presentation of data
- "Column C" sort data via internal ID;
Please inform me is it your case and is it work for you this example.
Regards
georgi
Yes, you can use a SortComparer on the column to sort the column any way you want. Do a Sort on these forums for SortComparer and I'm sure you will find some sample code, as well.