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

load on demand

1 Answer 44 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
steve
Top achievements
Rank 1
steve asked on 25 Sep 2009, 03:19 PM
I have three ienumerable collections that are being populated from a web service. Lets call them _division, _league, _team.
I have bound to the first collection _divison using

private IEnumerable<Divison> _Division;     
_Division = result.Object;     
treeResults.ItemsSource  = _Division;     
treeResults.DisplayMemberPath="DivisionName";     
treeResults.SelectedValuePath="DivisionID";    
 

 

Now i want to be able to load the next node with _League but only those who should apear in _division (i.e those from _League who have a _League.DivisionID == _Division.DivisionID).
And i finally want to be able to load _teams that belong to the loaded _League.
I also want to be able to set an image next to the node based on the selection. I have looked at all of your examples and cant quite get this to work.

All help greatfully appreciated.



1 Answer, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 29 Sep 2009, 09:06 AM
Hello steve,

This should be relatively easy to achieve. Just enable the load on demand of the treeview. Then in the LoadOnDemandEvent you can fetch only the leagues which are for the clicked division by passing its ID to the seb service. When the service returns the collection - assing it to the ItemsSource property of the clicked division node.

You can see a sample how to use the treeview with load on demand and web service here:
http://blogs.telerik.com/valerihristov/posts/08-10-08/silverlight_treeview_load_on_demand.aspx

Sincerely yours,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TreeView
Asked by
steve
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Share this question
or