VS2003: Issue with Bound, Sorted ComboBox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All,

I seem to have found a problem using a ComboBox. If you bind a ComboBox to
an ArrayList of classes, setting the DisplayMember to one field in the class
and the ValueMember to another, and the ComboBox is sorted, then the bounded
indices are incorrect.

It appears that the ComboBox is sorted on ValueMember, but the associated
DisplayMember does not come along for the ride.

pagates
 
pagates said:
Hello All,

I seem to have found a problem using a ComboBox. If you bind a
ComboBox to an ArrayList of classes, setting the DisplayMember to one
field in the class and the ValueMember to another, and the ComboBox
is sorted, then the bounded indices are incorrect.

It appears that the ComboBox is sorted on ValueMember, but the
associated DisplayMember does not come along for the ride.

Correct, I ran into this issue some time ago as well. I sorted the
arraylist with its Sort() method first, then bound it to the combobox
and not set the combobox as sorted.

FB

--
 
Back
Top