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

Basic hierarchies is not working in Gridview telerik silverlight

5 Answers 47 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Balsuyambu
Top achievements
Rank 1
Balsuyambu asked on 20 Aug 2010, 08:42 AM

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

Sort by
0
Milan
Telerik team
answered on 20 Aug 2010, 08:57 AM
Hello Balsuyambu,

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
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
Balsuyambu
Top achievements
Rank 1
answered on 20 Aug 2010, 09:43 AM
Hi Mila,

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.

0
Milan
Telerik team
answered on 23 Aug 2010, 10:02 AM
Hi Balsuyambu,

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
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
Dave Navarro
Top achievements
Rank 2
answered on 19 Dec 2011, 07:23 AM
Hello,

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
0
Maya
Telerik team
answered on 19 Dec 2011, 07:33 AM
Hi Dave Navarro,

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.
 

Best wishes,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Balsuyambu
Top achievements
Rank 1
Answers by
Milan
Telerik team
Balsuyambu
Top achievements
Rank 1
Dave Navarro
Top achievements
Rank 2
Maya
Telerik team
Share this question
or