1 posts, 0 answers
  1. Cheri
    Cheri avatar
    21 posts
    Member since:
    Jan 2012

    Posted 16 Aug 2012 Link to this post


    I'll describe my scenario and perhaps that will help to understand my issue.

    I have a combo box that contains a list of model numbers.  When I select a model from this list, it will display a photo in an image control, as expected.  The problem I am having, is if I programmatically set the selectedvalue of the combo box, the image never gets loaded.

    Any help would be appreciated!


    Here is my DomainDataSource definition
    <telerik:RadDomainDataSource Name="ddsModelDetail" QueryName="GetModelByID" AutoLoad="True">
            <server:IRISDomainContext />
            <telerik:QueryParameter ParameterName="id" Value="{Binding ElementName=rcbModel, Path=SelectedValue}" />

    And my combo box and image definition
    <Image x:Name="img"   Margin="5,10"
        HorizontalAlignment="Center" VerticalAlignment="Center" Height="96" Width="96" Stretch="UniformToFill" Source="{Binding DataView.PhotoFilePath, ElementName=ddsModelDetail}" />     
    <TextBlock Style="{StaticResource ROTextBlockStyle}"  Text="Model:"  />
    <telerik:RadComboBox  Name="rcbModel"  SelectedValue="{Binding ModelID, Mode=TwoWay}"  Style="{StaticResource ModelComboBoxStyle}" SelectionChanged="rcbModel_SelectionChanged"  />

    And the code to set the value
    Resource _res = (((System.ServiceModel.DomainServices.Client.LoadOperation<Resource>)sender).Entities).SingleOrDefault(t => t.ID == Convert.ToInt64(tbID.Text));

    rcbModel.SetValue(RadComboBox.SelectedValueProperty, _res.ModelID);

Back to Top