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

SelectedValue with SelectedValuePath not working!

1 Answer 216 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Valentijn
Top achievements
Rank 1
Valentijn asked on 26 Oct 2010, 02:43 PM
Hi

I try to set the selectedvalue of a combobox as specified in your examples but nothing happens.

 

 

 

<telerik:RadComboBox x:Name="cmbProvince" Grid.Row="2" Height="23" Width="184" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.ColumnSpan="2" ItemsSource="{Binding Path=Data, Source={StaticResource provinceDomainDataSource}}" SelectedValuePath="ProvinceId">

 

 

 

 

<telerik:RadComboBox.ItemTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<TextBlock Text="{Binding GlobalizedDescription, Converter={StaticResource localizeConverter}}" />

 

 

 

 

</DataTemplate>

 

 

 

 

</telerik:RadComboBox.ItemTemplate>

 

 

 

 

</telerik:RadComboBox>

 


In code:

 

 

this.cmbProvince.SelectedValue = ((Bass.Web.DataModel.PostalCode)postalCode).ProvinceId;

Debugging past this line still reveals SelectedValue to be null. It does not get updated. Can this have something to do with the itemtemplate that is in my combo?

Best regards and thanks for your help.

 

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 29 Oct 2010, 04:00 PM
Hello Valentijn,

I've attached a simple project based on your code to demonstrate that setting SelectedValue works without a problem. Please check again the used converter in the combobox template.

All the best, Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
Valentijn
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or