ChildTableDefinitions/PropertyRelation

7 posts, 1 answers
  1. Martin Søberg
    Martin Søberg avatar
    10 posts
    Member since:
    Dec 2009

    Posted 01 Feb 2010 Link to this post

     

     

    Hi,
    I am using the PropertyRelation on the RadgridView like so:

    <
    Telerik:RadGridView.ChildTableDefinitions

     

        <Telerik:GridViewTableDefinition x:Name="gvtd"> 

     

            <Telerik:GridViewTableDefinition.Relation

     

                <telerikData:PropertyRelation ParentPropertyName="MyProperty"/> 

     

            </Telerik:GridViewTableDefinition.Relation
        </Telerik:GridViewTableDefinition>
    </Telerik:RadGridView.ChildTableDefinitions>

    Which works fine when it autogenerates the columns.. is there an example on how to user define the columns?


    My futile tries involve:
    AutoGenerateColoumns="False"
    or   

    AutoGenerateFieldDescriptors

     

    ="False"

    I have tried setting the FieldDescriptors manually.

    Tried to use HierarchyChildTemplate like so:

     

     

     

    <Telerik:RadGridView.HierarchyChildTemplate

     

        <DataTemplate>

            <Telerik:RadGridView

     

                <Telerik:RadGridView.Columns
                    <Telerik:GridViewDataColumn Header="ID" UniqueName="id"/>

                    <Telerik:GridViewDataColumn Header="FirstName" DataMemberBinding="{Binding Name}"/>

                </Telerik:RadGridView.Columns>

            </Telerik:RadGridView>

        </DataTemplate>

    </Telerik:RadGridView.HierarchyChildTemplate>


    With the result of it loosing its binding and going back to the usercontrols dataContext.

    - Martin

     

     

     

     

     

     

     

     

     

     

  2. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 01 Feb 2010 Link to this post

    Hi Martin,

    You can successfully replace  GridViewTableDefinition with PropertyRelation with following HierarchyChildTemplate declaration:
    ...
    <Telerik:RadGridView.ChildTableDefinitions>
        <Telerik:GridViewTableDefinition />
    </Telerik:RadGridView.ChildTableDefinitions>
    <Telerik:RadGridView.HierarchyChildTemplate>
         <DataTemplate>
            <Telerik:RadGridView ItemSource="{Binding MyProperty}" AutoGenerateColumns="False"
                <Telerik:RadGridView.Columns>
                    <Telerik:GridViewDataColumn Header="ID" UniqueName="id"/>
                    <Telerik:GridViewDataColumn Header="FirstName" DataMemberBinding="{Binding Name}"/>
                </Telerik:RadGridView.Columns>
            </Telerik:RadGridView>
        </DataTemplate>
    </Telerik:RadGridView.HierarchyChildTemplate>
    ...
    Best wishes,
    Vlad
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Martin Søberg
    Martin Søberg avatar
    10 posts
    Member since:
    Dec 2009

    Posted 01 Feb 2010 Link to this post

    Hi Vlad
    Worked like a charm... saved my day :) 

    Thank you!
  5. Toby Riley
    Toby Riley avatar
    40 posts
    Member since:
    Aug 2012

    Posted 13 Jun 2010 Link to this post

    Hi Vlad,

    What if you still want to enforce the PropertyRelation between the Parent and the Child Items. You example chooses the correct child columns by the relation is lost.

    How do you maintain the related master detail relationship.

    Thanks

    Toby.
  6. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 14 Jun 2010 Link to this post

    Hello,

     Can you post more info about your scenario? How the grid is declared and bound in your case?

    Best wishes,
    Vlad
    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.
  7. james
    james avatar
    1 posts
    Member since:
    Aug 2010

    Posted 06 Jun 2012 Link to this post

    Hi Support,

    Is it possible to "inherit" the column definition from the parent table?

    I have implemented a column picker so the user can pick what columns are visible, i want this to affect the child tables.

    Regards,
    James
  8. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 07 Jun 2012 Link to this post

    Hi,

     Maybe you should bind columns visibility to all grid definitions if you want your setting to affect all grids including child grids in hierarchy. You can declare your child grids using HierarchyChildTemplate. 

    Kind regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
UI for WPF is Visual Studio 2017 Ready