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

Refresh?

0 Answers 64 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cheri
Top achievements
Rank 1
Cheri asked on 16 Aug 2012, 07:11 PM

Hello,

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!

Regards,
Cheri

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


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);

Tags
DomainDataSource
Asked by
Cheri
Top achievements
Rank 1
Share this question
or