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

Hierarchical GridView

1 Answer 86 Views
GridView
This is a migrated thread and some comments may be shown as answers.
JJ
Top achievements
Rank 1
JJ asked on 19 Jun 2011, 07:40 PM
I am new to Silverlight.

I watched the demo of "Custom Hierarchy Template". I don't see anywhere defines order and details relationship.
If I have 2 separate class (recordset), one for orders, one for details. I assume somewhere in the GridViewTableDefinition needs to define the relationship between 2 tables and also which field (orderid in order class) in parents table relates to which field (orderid in details table) in child table.

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

Why I don't see it's there. How do we know ues which order id pulls the order detail child grid for this order? 
Shoud it add the relationship under  <telerikData:TableRelation.FieldNames> like the self reference example?

Where is the code you get the orders and details class collection? I don't understand why the data can come without specify the relationship.

I used Ajax radgrid before, when i used ajax radgrid, I got details recordset under Radgrid1_DetailTableDataBind, query on detail table by passing dataItem.GetDataKeyValue("ID") from parent grid. Should I do the similar thing in Silverlight radgridview? I am using mvvm for the radgridview. Is it possible  that you can give me a detailed example for how to set the relationship between order and detail to serve the radgrid in this case?


Thanks,

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 Jun 2011, 06:51 AM
Hi,

 The relation is already created in the view-model. The parent grid is bound to Orders and every child grid is bound to respective order detail. Please check the XAML for for more info. I suggest you also to check this blog post for example to know more how to create hierarchy in your model and later bind it to the grid.  

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
JJ
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or