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

Specify column names for child relation grid

5 Answers 160 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Daniil
Top achievements
Rank 1
Daniil asked on 22 Jun 2010, 01:12 PM
Hello,

How is it possible to specify columns for child table?

I don't want columns for hierarchical grid to be auto generated.

I'm reading http://www.telerik.com/help/wpf/gridview-basic-hierarchies.html but it does not seam to be there

Thank You

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 22 Jun 2010, 01:24 PM
Hi,

 You can use HierarchyChildTemplate similar to this demo to define your child tables.

All the best,
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
Daniil
Top achievements
Rank 1
answered on 28 Jun 2010, 02:01 PM
I'm sorry, but I still don't get it. Could you please make a WPF example?
0
Maya
Telerik team
answered on 28 Jun 2010, 03:04 PM
Hello Daniil,

I am sending you a sample project demonstrating how to set the columns in a child grid. The things you need to do for defining them is to add a ChildTableDefinition:

<telerik:RadGridView.ChildTableDefinitions>
     <telerik:GridViewTableDefinition />
</telerik:RadGridView.ChildTableDefinitions>

And then to create the HierarchyChildTemplate:

<telerik:RadGridView.HierarchyChildTemplate>
     <DataTemplate>
        <telerik:RadGridView Name="playersGrid"
                             ItemsSource="{Binding Players}"
                             AutoGenerateColumns="False">
       <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn UniqueName="NameColumn" DataMemberBinding="{Binding Name}"/>
        <telerik:GridViewDataColumn UniqueName="NumberColumn" DataMemberBinding="{Binding Number}"/>
                             
                             
      </telerik:RadGridView.Columns>
       </telerik:RadGridView>
     </DataTemplate>
</telerik:RadGridView.HierarchyChildTemplate>  


The corresponding demo example for RadControls for WPF could be found here.

Regards,
Maya
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
Tarik
Top achievements
Rank 1
answered on 10 Sep 2010, 05:05 PM
Could you please show an example that access the grid children grids via code?
0
Vlad
Telerik team
answered on 13 Sep 2010, 07:20 AM
Hi,

 You can use DataLoading/AutoGeneratingColumn events to assess auto-generated child grid columns 

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
Tags
GridView
Asked by
Daniil
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Daniil
Top achievements
Rank 1
Maya
Telerik team
Tarik
Top achievements
Rank 1
Share this question
or