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

SelectedValue on Page Load

1 Answer 56 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 31 Aug 2011, 10:40 PM
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?

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 01 Sep 2011, 01:26 PM
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 >>

Tags
ComboBox
Asked by
Eric
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or