Hi
Basic hierarchies is not working in server side with latest telerik version 2010 SP1 and it is working in 2009 SP2 in Gridview telerik silverlight control.
Note : User will set the datasource at runtime and object/class may vary from time to time.
Thanks
Balsuyambu S.
5 Answers, 1 is accepted
We would really appreciate it if you could give us more information about your scenario so that we can try to replicated on our site. For example, that is the structure of the data, how is the grid configured, etc.
Sincerely yours,
Milan
the Telerik team
Thanks for your quick reply
Please find below the XAML Code
<Grid x:Name="LayoutRoot" Background="White">
<MyGrid:RadGridView Name="patternGrid" >
<MyGrid:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<MyGrid:RadGridView Name="stylesGrid" ShowGroupPanel="False" >
<MyGrid:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<MyGrid:RadGridView Name="attributesGrid" ShowGroupPanel="False" >
</MyGrid:RadGridView>
</DataTemplate>
</MyGrid:RadGridView.HierarchyChildTemplate>
</MyGrid:RadGridView>
</DataTemplate>
</MyGrid:RadGridView.HierarchyChildTemplate>
</MyGrid:RadGridView>
XAMS.cs code
public MainPage()
{
InitializeComponent();
GridViewTableDefinition d = new GridViewTableDefinition();
d.Relation =
new PropertyRelation("Orders");
this.patternGrid.ChildTableDefinitions.Add(d);
this.BuildCustomers();
}
private void BuildCustomers()
{
this.customers = new ObservableCollection<Customer>();
var orders = new ObservableCollection<Order>();
for (int i = 0; i < 10; i++)
{
orders.Add(
new Order { CustNumber = i, Number = i, Details = "Order" + i });
}
for (int i = 0; i < 20; i++)
{
customers.Add(
new Customer { Email = "Mail" + i, Name = "Name" + i, Number = i, Orders = orders });
}
this.patternGrid.ItemsSource = customers;
}
We have done the POC based on below URL
http://www.telerik.com/help/silverlight/gridview-basic-hierarchies.html
Note : className of ("Customer" and "Order") may vary and it depends on run time.
Kindly validate
Thanks
Balsuyambu S.
The setup is a bit different when using HierarchyChildTemplate. For your scenario you should first define a dummy TableDefinition like so:
<telerik:RadGridView.ChildTableDefinitions>
<telerik:GridViewTableDefinition />
</telerik:RadGridView.ChildTableDefinitions>
And finally you should bind the ItemsSource property of the details grid to the details data - in your case that is the Orders property:
<
telerik:RadGridView.HierarchyChildTemplate
>
<
DataTemplate
>
<
telerik:RadGridView
ItemsSource
=
"{Binding Orders}"
>
</
telerik:RadGridView
>
</
DataTemplate
>
</
telerik:RadGridView.HierarchyChildTemplate
>
Sincerely yours,
Milan
the Telerik team
I'm trying to setup some Basic Hierarchies like the ones described here but want to know if this code is still the current solution now that we're using Q3 2011 builds.
Please let me know and thanks!
~ Dave
The approach for defining hierarchical grid and the corresponding child table definitions has not been changed so far. Please take a look at our online documentation and demos for additional reference and let us know if you need any assistance.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>