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

Data Paging for hierarchical data (HierarchyChildTemplate )

6 Answers 82 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 1
Igor asked on 25 Oct 2010, 09:00 PM
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.

6 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 26 Oct 2010, 07:23 AM
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
0
Igor
Top achievements
Rank 1
answered on 27 Oct 2010, 02:03 AM
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>

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

0
Vlad
Telerik team
answered on 27 Oct 2010, 07:22 AM
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
0
Igor
Top achievements
Rank 1
answered on 29 Oct 2010, 04:07 AM

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.

0
Accepted
Vlad
Telerik team
answered on 29 Oct 2010, 07:12 AM
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
0
Igor
Top achievements
Rank 1
answered on 01 Nov 2010, 03:18 AM
Thanks Vlad, I got it working right, appreciate your help very much!
Tags
DataPager
Asked by
Igor
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Igor
Top achievements
Rank 1
Share this question
or