Link to domaindatasource one in a Row Master and other in the Row Detail

1 posts, 0 answers
  1. GG
    GG avatar
    5 posts
    Member since:
    Feb 2012

    Posted 02 Mar 2012 Link to this post

    Hello,

    I made a Row Detail Template the Row Master is a RadGridView and the Row Detail is another one RadGridView. The two RadGridView have their ItemsSource property bind to two different RadDomainSource. (I understand it is not the better way to use the Row Master/Detail Template but it seems it is my only solution.)
    The problem is the inner RadGridView get its ItemsSource from a column of the Parent RadGridView's Row.
    I show you a bit of code:

    The DomainDatasource :
    <telerik:RadDomainDataSource
        Name="ddsPeopleMaster"
        x:Key="resPeopleMaster"
        QueryName="GetTabPeopleMasterQuery"
        AutoLoad="True">
        <telerik:RadDomainDataSource.QueryParameters>
            <telerik:QueryParameter ParameterName="myId" Value="{Binding myId}" >
            </telerik:QueryParameter>
        </telerik:RadDomainDataSource.QueryParameters>
        <telerik:RadDomainDataSource.DomainContext>
            <local:BID_RegisterContext />
        </telerik:RadDomainDataSource.DomainContext>
    </telerik:RadDomainDataSource>
    <telerik:RadDomainDataSource
        Name="ddsPeopleDetail"
        x:Key="resPeopleDetail"
        QueryName="GetTabPeopleDetailQuery"
        AutoLoad="True">
        <telerik:RadDomainDataSource.QueryParameters>
            <telerik:QueryParameter ParameterName="myId" Value="{Binding myId}" />
            <!-- LOOK THIS LINE -->
            <telerik:QueryParameter ParameterName="PeopleId" Value="{Binding People_Id, ElementName=gdPeopleMaster}" />
            <!-- LOOK THIS LINE -->
        </telerik:RadDomainDataSource.QueryParameters>
        <telerik:RadDomainDataSource.DomainContext>
            <local:BID_RegisterContext />
        </telerik:RadDomainDataSource.DomainContext>
    </telerik:RadDomainDataSource>

    The RadGridView :
    <telerik:RadGridView
        Name="gdPeopleMaster"
        AutoGenerateColumns="False"
        ItemsSource="{Binding DataView, Source={StaticResource resPeopleMaster}}">
        <telerik:RadGridView.Columns>
            <!-- Toggle -->
            <telerik:GridViewToggleRowDetailsColumn />
            <!-- People Name -->
            <telerik:GridViewDataColumn
                Header="People Name"
                DataMemberBinding="{Binding People_Name}">
            </telerik:GridViewDataColumn>
            </telerik:GridViewDataColumn>
        </telerik:RadGridView.Columns>
        <telerik:RadGridView.RowDetailsTemplate>
            <DataTemplate>
                <telerik:RadGridView
                    x:Name="gdPeopleDetail"
                    AutoGenerateColumns="True"
                    ItemsSource="{Binding DataView, Source={StaticResource resPeopleDetail}}">
                </telerik:RadGridView>
            </DataTemplate>
        </telerik:RadGridView.RowDetailsTemplate>
    </telerik:RadGridView>

    I have commented the line where I have a problem.
Back to Top