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

SelectedItem vs ItemsSource

3 Answers 67 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 15 Jun 2012, 01:32 PM
Hi,

in my RadWindow I have a RadComboBox, when I show my RadWindow, I already have an object and I set the Text property of my RadComboBox but at the same time, I have a running BackgroundWorker who get the ItemSource data of my RadComboBox. The BackgroundWorker take about 3 or 4 seconds to get all the data for the RadComboBox.

When my BackgroundWorker is completed, I set the ItemsSource of my RadComboBox but the Text property of my RadComboBox are not synchronize with their ItemSource. If I click on the dropdown button of my RadComboBox, the corresponding value in the dropdown are highlight.

How I can fix tthis?

Thank's

3 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 20 Jun 2012, 09:01 AM
Hi Oliver,

Could you please send us some screenshots with the issue. What do you mean by the Text is not synchronized with the ItemsSource? Does the ComboBox display the type of the date item? If so, you have to set the ItemTemplate property of the RadComboBox.

Regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Oliver
Top achievements
Rank 1
answered on 20 Jun 2012, 01:08 PM
Hi Konstantina,

when I show my RadWindow, I set the Text property of my 3 RadComboBox, at this time, the ItemsSource of all RadComboBox are empty. Immediatly when the Text property was set, I start a backgroundworker to get the ItemsSource of each RadComboBox, the backgroundworker take around 4 seconds to complete. When the backgroundworker completed, I set the ItemsSource property of each RadComboBox. After that, If I click on the dropdown button of the RadComboBox 1, 2 or 3, the value in the Text property are not highlight in the dropdown, of course the value exist in the dropdown.

Thank's
0
Konstantina
Telerik team
answered on 21 Jun 2012, 10:40 AM
Hi,

The Text property sets only the text in the RadComboBox, not the selected item. If you want the item to be selected when you open the drop-down, you need to set the SelectedItem or SelectedValue property of the RadComboBox. However, due to an issue with the ComboBox, you have to set this property after the ItemsSource is already loaded.

Greetings,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
ComboBox
Asked by
Oliver
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Oliver
Top achievements
Rank 1
Share this question
or