I'm using the RadGridView with a DataPager on a Parent Grid and it works fine. For each row in the ParentGrid, I'm defining a RowDetailsTemplate to have a child binded grid. This also works fine, but I can't use the DataPager with the inner child grid. The reason seem obvious to me, but the solution is not. I think the problem is that I can not name the child grid using x:name, because then the child grid for each row will have the same name, causing an error. If I can't name the child grid, how do I link the data pager?
Is there a way to link a RadGridView with a DataPager, without assigning a specific x:name to the RadGridView and DataPager: Element?
Or perhaps Is there a way to assign a x:name to the RadGridView at runtime, and also link it to the DataPager:Element at runtime? In this case I would name each Rows ChildGrid as ChildGrid0, ChildGrid1, ChildGrid2, etc... assuring that each child grid had a unique name. I'm originally from the Jsp/Java world and this kind of name iteration at runtime is quite easy. It's perhaps the only thing so far that is easier in Jsp.
Here is a sampe mock-up of the code. My actual code has a bit more detail, but I stripped it down for the purpose of this example:
<data:DataGrid x:Name="ParentGrid" AutoGenerateColumns="True"> <data:DataGrid.RowDetailsTemplate> <DataTemplate> <StackPanel> <telerikGridView:RadGridView x:Name="ChildGrid" ItemsSource="{Binding ActualTerms}" AutoGenerateColumns="True"/> <data:DataPager Source="{Binding ItemsSource, ElementName=ChildGrid}" PageSize="4"></data:DataPager> </StackPanel> </DataTemplate> </data:DataGrid.RowDetailsTemplate> </data:DataGrid> <data:DataPager Source="{Binding ItemsSource, ElementName=ParentGrid}" PageSize="4"></data:DataPager>
Software/Hardware used:
ASKED:
February 1, 2010 3:42 PM