SelectedValue on Page Load

2 posts, 0 answers
  1. Eric
    Eric avatar
    17 posts
    Member since:
    Aug 2011

    Posted 31 Aug 2011 Link to this post

    I have a RadComboBox that is being loaded from a MVVM pattern.

            <telerik:RadComboBox x:Name="txtProduction" 
                          DisplayMemberPath="Name"
                          ItemsSource="{Binding ProductionCenters}"
                          SelectedValuePath="ID"     
                          />

    It is located on a Silverlight User Control

    When the control is displayed, everything looks beautiful.
    But when i try to Set the SelectedValue i cannot get it to work.
    I have tried setting a routing on loading the control, but the items.count for my combobox is 0
    I have even created a Loaded Event.  Even after it fires the Items.Count for the ComboBox is 0.

    After everything is displayed on my screen, my Count is "5"

    How do i force the combo box to load, or set my SelectedValue AFTER the combobox has finished loading?
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 01 Sep 2011 Link to this post

    Hello Eric,

    In order to overcome this issue, you need to set the items at once, not one by one. When the data is loaded, then set the ItemsSource of the ComboBox and the SelectedValue should work correctly.

    Please let us know how did that work for you.

    Best wishes,
    Konstantina
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft banner
Back to Top