This is a migrated thread and some comments may be shown as answers.

Setting default item selected in dropdown

1 Answer 93 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Bort
Top achievements
Rank 1
Bort asked on 09 Mar 2011, 08:47 PM
I am using the combobox in EnableLoadOnDemand mode. The data in the drop down has three collums (ID, Name, Address). I set my default selected item like this:
 
Me.RadComboBox.SelectedValue = "9238"
Me.RadComboBox.Text = "Smith, Jones"

I happen to have 3 "Smith, Jones"  in my database each with different IDs. When I click on the drop down, the control is smart enough to get the 3 smiths matching the text in the dropdown but the selected item in the list is always the first one. The item with the 9238 ID happens to be the third item in the list so the default selection is invalid pointing to the wrong customer confusion my users. Is there a way to get the selected item in the drop down list to match the ID that I have set as the default starting value? It seems to me this should be a default behavior.

1 Answer, 1 is accepted

Sort by
0
Bort
Top achievements
Rank 1
answered on 09 Mar 2011, 09:55 PM
I figured out a workaround. Don't use MarkFirstMatch="true". Sucks because I want that normaly but just not on initial default render.
Tags
ComboBox
Asked by
Bort
Top achievements
Rank 1
Answers by
Bort
Top achievements
Rank 1
Share this question
or