Sorted combobox displays wrong data

G

Guest

Hi!
I have a tedious problem with comboboxes, as they don't display data
correctly.
Suppose I have a combobox "cmbEmployees" that shows Employee objects; class
Employee has an "Id" member and a "CompleteName" member. I set up my combobox
so to have "Id" as valuemember and "CompleteName" as displaymember. This
works good when I bind my data (cmbEmployees.DataSource=dao.GetEmployees()
and then getting an Id to display and setting cmbEmployees.SelectedValue to
it). The weird things come when I set the "Sorted" property to true... The
combobox doesn't display the employee with the requested Id... What's wrong?
Thank you in advance!!
Paolo
 
G

Guest

It doesn't solve the problem, but shows how the Sorted property works (and we
can say it works BAD). The only solution is to create something like
"GetSortedEmployees()" method in my dao objects.
Thank you, the link was helpful!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top