I'm trying to show a radgridview into a hierarchical radgridview item.
Now i bind the treelistview with "Capitulos" Items and i have the next structure:
Capitulo 1
Capitulo 1.1
Capitulo 1.1.1
Capitulo 2
Capitulo 3
I need to show this one:
Capitulo 1
Capitulo 1.1
Product c
Product d
Product e
Capitulo 1.1.1
Product a
Product b
Capitulo 2
Capitulo 3
12 Answers, 1 is accepted
You can use the approach demonstrated in this online example . There is a source code as well.
You may see that the child grids are defined in a HierarchyChildTemplate. This way you may nest as many levels as you wish - you can set the child grid in the HierarchyChildTemplate the same way as the parent was set.
Best wishes,
Pavel Pavlov
the Telerik team

Hi, I'm trying with this code but I only get this structure:
CapÃtulo 1
Producto a
Producto b
CapÃtulo 2
Producto c
Producto d
I need to show this other structure:
CapÃtulo 1
Producto a
Producto b
CapÃtulo 1.1
Producto e
Producto f
CapÃtulo 2
Producto c
producto d
<telerik:RadGridView x:Name="RadGridView1" CanUserFreezeColumns="False"
ColumnWidth="*" ItemsSource="{Binding capÃtulos}"
GridLinesVisibility="Horizontal"
IsReadOnly="True" AutoGenerateColumns="false">
<telerik:RadGridView.ChildTableDefinitions>
<telerik:GridViewTableDefinition />
</telerik:RadGridView.ChildTableDefinitions>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding codc}" Header="codc" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding capÃtulo}" Header="CapÃtulo" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<telerik:RadGridView x:Name="RadGridView1" CanUserFreezeColumns="False" AutoGenerateColumns="False" ItemsSource="{Binding productos_planificados}" ShowGroupPanel="False" IsReadOnly="True">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding CODP}" Header="CODP" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Producto}" DataFormatString="{}{0:c}" Header="Producto" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</DataTemplate>
</telerik:RadGridView.HierarchyChildTemplate>
</telerik:RadGridView>
Dim
dbgesto As New GESTOSQLDataContext
Dim miscapis = From c In dbgesto.capÃtulos
Select c
Where c.CODIGOOBRA = 70
RadGridView1.ItemsSource = miscapis
Hi Axel Blasco,
Judging from the example that has been given I believe that you are trying to achieve some kind of hybrid grouping scenario that has mixed types on every level. Could you please provide us with more information about your data structures and how the relate to each other so that we can have a better understanding of the the scenario.
Best wishes,
Milan
the Telerik team

The structure i want to show it's like this:
CapÃtulo 1
Producto a
Producto b
CapÃtulo 1.1
Producto e
Producto f
CapÃtulo 2
Producto c
producto d
Table CapÃtulos (This table contains the structure of a construction project and this is the hierarchy structure)
id
Description
parentid
Table Productos (This table contains the products of each CapÃtulo)
id
description
price
idcapitulo
In order to provide you with a suitable solution, I would need a bit more details on your exact requirements. How do you expect your application to be displayed ? Do you want to show only the description of those items and to visualize it like RadTreeView ? Or display it like RadTreeListView ? Or probably in a hierarchical structure by using RadGridView ?
Maya
the Telerik team

Description Produccion Cost
Capítulo 1 58€ 55€
Description Price Quantity Cost
Producto a 5€ 15 4€
Producto b 8€ 30 7€
Capítulo 1.1
Description Price Quantity Cost
Producto e 5€ 15 4€
Producto f 8€ 30 7€
Capítulo 2
Description Price Quantity Cost
Producto a 5€ 15 4€
Producto b 8€ 30 7€
Thanks and sorry but i don't know how to describe it you
I am sending you a sample project illustrating how you may achieve similar structure using a hierarchical RadGridView.
Let me know whether it corresponds to your particular requirements.
Maya
the Telerik team

I need something like this sample but with unlimited child levels.
Sample:
Club
Players
Sub CLub
Players
Sub Sub CLub
Players
.......
A lot of thanks for your time.
The exact implementation depends entirely on your custom requirements and data model. You may extend the level of hierarchy in the same way as illustrated in the sample project by defining the necessary amount of ChildTableDefinitions and HierarchyChildTemplates.
Maya
the Telerik team

I have projects with 3 levels, 20 levels , etc...
I think that the solution is to create this childtable definitions from code but i don't know how to do it.
You may use the following forum thread for reference. The same is valid for Silverlight as well.
Vanya Pavlova
the Telerik team

<telerik:GridViewTableDefinition>
<telerik:GridViewTableDefinition.Relation>
<telerik:PropertyRelation ParentPropertyName="XXX" />
</telerik:GridViewTableDefinition.Relation>
</telerik:GridViewTableDefinition>
</telerik:RadGridView.ChildTableDefinitions>
The XXX should be replaced with the collection property name which is also the items source for child table.