Hi,
I have a templatecolumn in my grid named ExpirationDate. It has an image with a warning sign and a textblock with the exact ExpirationDate.
The key of the column is an enum I receive from the server (Overdue, Less30Days, Less60Days,...)I do this because I want the user to be able to group by these values.
Everything works fine, except for the sorting offcourse...The column is sorted based on the enum values and not an the ExpirationDate
Is there a way to speficy another column for sorting?
Thx,Bart
Hi Bart,
So you've got 2 options then.
You can provide a custom SortComparer and use the Enum Key, or provider a GroupByComparer and use the ExpirationDate Key.
http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=SL_xamGrid_Custom_Sort.html
http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=SL_xamGrid_Custom_GroupBy.html
Now i suppose there is a third option, but i haven't tried it. But what you could do is make the ExpriationDate a hidden TextColumn. And use the sorting events. Basically when ever the Enum column is being sorted you could remove it and sort by the ExpirationDate column instead.
I hope one of these suggestions helps you,
-SteveZ
Hi SteveZ,
I set the key to the enum because I want this field to be used for grouping.Grouping by those enums makes more sense than grouping by the actual dates.
Bart
Since this is a TemplateColumn you can just make the Key of your column to be ExpirationDate and it should sort by that field. And it'll still display you're enum field.