Hi
I need some help in sorting the column filter DropDownList. I've got a grid with some columns and one of them is of type DateTime. So my customer wants to filter the data in the grid upon the date-value in this column (ex. all info from January, 1st). There's a huge amount of data in the grid with date-values from 10years ago. By standard I get a DropDownList when activating the grids column filtering ability. The data in this list is sorted ascending and not descending. This means always if you want to filter the data, you need to scroll-down because usualy you don't want to filter after the data from years before.
My question now, is there a posibility to change the sorting in this DropDownList by implementing an interface or something like this?
Thank you for the support!Nicolas
Ok, in the meantime I found a solution.
You can subscribe to the BeforeRowFilterDropDown event of the UltraWinGrid. In the EventArgs you have the ability to change the sorting of the list by:e.ValueList.SortStyle = Infragistics.Win.ValueListSortStyle.DescendingByValue;
This is a solution but there are two problems left for me.
1) I've never heard of this. What exactly is the exception and what's the call stack?
2) You can modify the ValueList passed into this event in any way you like.So what you could do is remove all of the item from the list, except for the built-in ones like All and Custom. Then you could sort the dates and re-add the items to the ValueList in the order you want.
Hi Mike
I'm sorry for the first one. It's a failure in the customers application. There's a routine which deletes all built-in functions expect the (All). This routine wasn't compatible with my extension... :-(
The implementation of the sort routine as you explained was also my opinion and that's the way I did it. But wouldn't it be cool, if the build-in implementation would sort the filter ValueList by the columns sorting and the build-in functions like (All) will be always on top?=> I'd like this as a feature for a feature release! :-)
Kind regards,Nicolas
Hi Nicolas,
Yes, that does sound like a good idea. Does the ValueList expose a SortComparer? If it does, that would be an easier way to implement the sorting you want.
If not, you should submit your idea to Infragistics as a feature request: Request a Feature or Component
Unfortunately there's no SortComparer implementation. Finally I get it done and posted a feature request. Also i posted a blog entry here:http://blog.trivadis.com/blogs/nicolasmueggler/archive/2008/01/30/sorting-entries-in-infragistics-ultrawingrid-rowfilterdropdown-by-the-columns-sort-order.aspx