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

ComboBox with relationship table.

1 Answer 68 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mehmet
Top achievements
Rank 1
Mehmet asked on 28 Aug 2011, 04:19 PM

Hi Telerik,

I want to bind the two ComboBox with relationship table.
but I can't bind second ComboBox.

I send you Table and source code.

Could you please send us the correct application.
Thanks,

    <UserControl.Resources>
        <riaControls:DomainDataSource x:Name="TestData" AutoLoad="True" QueryName="GetTest" >
            <riaControls:DomainDataSource.DomainContext>
                <domain:HotelDomainContext />
            </riaControls:DomainDataSource.DomainContext>
            <riaControls:DomainDataSource.FilterDescriptors>
            </riaControls:DomainDataSource.FilterDescriptors>
        </riaControls:DomainDataSource>
    </UserControl.Resources>

        <TextBlock Grid.Row="0" Grid.Column="0" Text="Category :"  HorizontalAlignment="Left" Margin="5,2,5,2"/>
        <telerik:RadComboBox x:Name="Category" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Top" MaxHeight="22"  Margin="5,2,5,2"  Width="160"    IsEditable="True" ItemsSource="{Binding Data,Source={StaticResource TestData}}" SelectedValuePath="Deneme" DisplayMemberPath="Name" Text="{Binding Name, Mode=TwoWay}"/>

        <TextBlock Grid.Row="0" Grid.Column="1" Text="Sub Category :"  HorizontalAlignment="Left" Margin="5,2,5,2"/>

        <telerik:RadComboBox x:Name="SubCategory" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top"     MaxHeight="22"  Margin="5,2,5,2"  Width="160"
 ItemsSource="{Binding ElementName=Category, Path=SelectedValue}"   Text="{Binding Name, Mode=TwoWay}"   IsEditable="True"/>

1 Answer, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 01 Sep 2011, 05:17 PM
Hi Mehmet,


I reviewed your code and didn't notice anything wrong. The only thing I suspect may causes the problem is this:
SelectedValuePath="Deneme"
The SelectedValuePath should point the path to the sub categories of the selected category. You can find an attached working sample project.

Hope this helps.

Kind regards,
Ivo
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
Mehmet
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or