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

Loading child grid on demand

1 Answer 68 Views
GridView
This is a migrated thread and some comments may be shown as answers.
wdudek
Top achievements
Rank 1
wdudek asked on 14 Jun 2010, 03:59 PM
Hi,

    I've been trying to get this to work for several days now unsuccessfully. Here is my scenario, I have a webservice that returns a listof objects that have about 50 fields. What I am trying to do is initially display only several of the fields, and give the user the ability to expand a child grid that will then bind to the same object that the parent is bound to and display all fifty fields. All of the examples I am finding seem to do all of the binding at once, and not "on deman" I've noticed performance problems when I do this which is why I want to take this approach. I essentially always want there to be a button to expand the grid, but do not want to populate the child until that button is clicked. Can someone lead me in the right direction? I'm really just looking for a link to something that does this already, so far I've found the hierarchical grids in silverlight slightly confusing.

Thanks
Bill

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 15 Jun 2010, 05:56 AM
Hi Bill,

 You have various options to achieve hierarchy on demand. Since the grid itself will touch child data on demand you can use pure MVVM approach to load your hierarchical data similar to my blog post or you can simply declare your child grid using HierarchyChildTemplate, catch Loaded event, retrieve your child data based on ParentRow.DataContext (your parent data item) and bind the child grid. 

You can check this blog post as well to know more how to do the same with row-details. 

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