Auto select first item

2 posts, 0 answers
  1. Michael
    Michael avatar
    7 posts
    Member since:
    Sep 2011

    Posted 27 Oct 2012 Link to this post

    I have a RadComboBox bound to an ObservableCollection. The collection is modified and cleared pragmatically (via various user interactions).

    I'm looking for a XAML friendly solution that will set the SelectedIndex to 0 when going from no items (no selection) to having items.

    I've tried simply setting SelectedIndex=0 but that doesn't work. (I get no selection).


  2. Vladi
    Vladi avatar
    749 posts

    Posted 01 Nov 2012 Link to this post

    Hi Mike,

    Unfortunately if you change the ItemsSource of the control you will need to set the SelectedIndex in the code behind. The initially declared in the xaml SelectedIndex gets reset because it is associated with old ItemsSource.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top