SelectedItem vs ItemsSource

4 posts, 0 answers
  1. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 15 Jun 2012 Link to this post

    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
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 20 Jun 2012 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 20 Jun 2012 Link to this post

    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
  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 21 Jun 2012 Link to this post

    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 >>
Back to Top