0
votes

I have an issue while sorting out dates in a ComboBoxEdit. Using this line of code :

cbeDates.Sorted = true

Sorts the items in a weird way. The output is :

01/01/2013
01/02/2013
01/03/2013
.... 
02/01/2013
02/02/2013
....

But I want the following expected output :

01/01/2013
02/01/2013
.... 
01/02/2013
02/02/2013

Did you guys ever deal with this kind of issue ? Thanks in advance for your replies.

2
how do you set the data? - Jens Kloster

2 Answers

1
votes

The sort works alphabetically. You can sort the datasource and then bind it to combobox or add the items in a sorted order.

Another solution is to use the IComparable interface. The ComboBoxEdit performs the comparison of objects using the System.Collections.Comparer class. For sample code, please take a look at the links below.

http://www.devexpress.com/Support/Center/Question/Details/B97090
http://www.devexpress.com/Support/Center/Question/Details/A304

0
votes

In Properties, try setting the Display Format and Edit Format to DateTime d