Data Paging for hierarchical data (HierarchyChildTemplate )

7 posts, 1 answers
  1. Igor
    Igor avatar
    5 posts
    Member since:
    Oct 2010

    Posted 25 Oct 2010 Link to this post

    Hi,

    I have RadGridView incorporating RadGridView.HierarchyChildTemplate . Is that possible to define Data paging for both views, main and hierarchical one (hierarchical - i mean data shown by expanding rows of main view)?
    just for info,  I'm using view data model rather than code behind.

    Thanks,
            -Igor.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 26 Oct 2010 Link to this post

    Hello Igor,

     It will be no problem to use RadDataPager in HierarchyChildTemplate together with the child grid. 

    Greetings,
    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
  3. DevCraft banner
  4. Igor
    Igor avatar
    5 posts
    Member since:
    Oct 2010

    Posted 26 Oct 2010 Link to this post

    Hi Vlad,
    Thanks for the reply. I tried setting up Data Paging for childs but that had no effect on view. I can set data paging for main, parent view w/o issue but not for child ones. Here is my xaml , please see below (i guess the change is xaml driven, right?).
    I'm not sure where should i define <telerik:RadDataPager ...   . If i define it after </telerik:RadGridView> I got paging in parent/main view. If i do this in other places I get some errors right away.

    Thanks again.

    /*****************************

    <StackPanel>

            <telerik:RadGridView x:Name="RadGridView1" IsReadOnly="True" ShowGroupPanel="False" CanUserSortColumns="True" ItemsSource="{Binding somebinding, Mode=TwoWay}" AutoGenerateColumns="False">

                <telerik:RadGridView.ChildTableDefinitions>

                    <telerik:GridViewTableDefinition />

                </telerik:RadGridView.ChildTableDefinitions>

                <telerik:RadGridView.Columns>

                    <telerik:GridViewDataColumn DataMemberBinding="{Binding somebinding, Mode=TwoWay}" Width="120" Header=" someheader"/>

                    <telerik:GridViewDataColumn DataMemberBinding="{Binding somebinding, Mode=TwoWay}" Width="40" Header="someheader"/>

                    …some more columns

                </telerik:RadGridView.Columns>

     

                    <telerik:RadGridView.HierarchyChildTemplate>

                    <DataTemplate>

                        <telerik:RadGridView x:Name="RadGridView2" CanUserFreezeColumns="False" AutoGenerateColumns="False" ItemsSource="{Binding ChildModel, Mode=TwoWay}" IsReadOnly="True">

                            <telerik:RadGridView.Columns>

                                <telerik:GridViewDataColumn DataMemberBinding="{Binding somebinding, Mode=TwoWay}" Width="120" Header="someheader"/>

                                <telerik:GridViewDataColumn DataMemberBinding="{Binding somebinding, Mode=TwoWay}" Width="40" Header="someheader "/>

                                                                     … some more columns

                            </telerik:RadGridView.Columns>

                        </telerik:RadGridView>

                    </DataTemplate>

                </telerik:RadGridView.HierarchyChildTemplate>

            </telerik:RadGridView>

        </StackPanel>

    /***********************************

  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 27 Oct 2010 Link to this post

    Hi Igor,

     Here is an example how to define both child grid and pager:
    <telerik:RadGridView.HierarchyChildTemplate>
       <DataTemplate>
         <Grid>
            <Grid.RowDefinitions>
               <RowDefinition />
               <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <telerik:RadGridView ItemsSource="{Binding ChildModel}" />
            <telerik:RadDataPager Source="{Binding ChildModel}" Grid.Row="1" />
          </Grid>
         </DataTemplate>
    </telerik:RadGridView.HierarchyChildTemplate>

    In this case however ChildModel should be IPagedCollectionView - for example QueryableCollectionView. 

    I've noticed also that the master grid is inside StackPanel - this control will measure the grid with infinity and you will get serious performance problems (the grid will try to create all rows at once). 

    Greetings,
    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
  6. Igor
    Igor avatar
    5 posts
    Member since:
    Oct 2010

    Posted 28 Oct 2010 Link to this post

    Thanks again for the help!. I got paging working for both parent and child grids. However, I have performance issues in case when
    there are thousands (like > 10) of rows in child view and I when try to expand that row with so many child’s. At the same time I see that IE memory(on client) is going up till IE eventually stops responding. I put master grid out of StackPanel is you advised.  What should I do in order to fix this? I guess I need something that would cause client to display predefined number of rows and holding only limited number of rows in memory on client. Is that possible?

     

    -Igor.

  7. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 29 Oct 2010 Link to this post

    Hi Igor,

     Please define Height for the child grid as well since HierarchyChildTemplate will measure control with infinity as well. 

    Greetings,
    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
  8. Igor
    Igor avatar
    5 posts
    Member since:
    Oct 2010

    Posted 31 Oct 2010 Link to this post

    Thanks Vlad, I got it working right, appreciate your help very much!
Back to Top
DevCraft banner