RadTreeViewItem and mapNamespace:Location

2 posts, 0 answers
  1. Roland Ackermann
    Roland Ackermann avatar
    1 posts
    Member since:
    Oct 2009

    Posted 12 Mar 2010 Link to this post

    I am trying to navigate the map via the RadTreeViewItem rather than the ListBox

    I have the following code for the RadTeeViewItem:- 




    <telerikNavigation:RadTreeViewItem Header="Germany (3)" IsExpanded="True">  
           <mapNamespace:Location Description="Munich" Latitude="48.139126" Longitude="11.580186" />                         
           <mapNamespace:Location Description="Berlin" Latitude="52.5166667" Longitude="13.4" /> 
           <mapNamespace:Location Description="Frankfurt" Latitude="50.1166667" Longitude="8.6833333" />                          

    The problem is that that the Description is not displayed in the Tree. Just blank nodes.























  2. Velin
    Velin avatar
    391 posts

    Posted 16 Mar 2010 Link to this post

    Hi Roland Ackermann,

    The RadTreeViewItem control is designed to work inside a RadTreeView control. The RadTreeView control is used to show hierarchical data and the best way to take advantage of this is to data bind the control to a hierarchical data source.

    However, it is possible to manually populate the tree view with nodes and data bind each of them. Here is a code that should work for you: 
                    <telerikNavigation:RadTreeView x:Name="RadTreeView1" >
                        <telerikNavigation:RadTreeViewItem x:Name="item1" DisplayMemberPath="Description" Header="Germany (3)" IsExpanded="True" />
    //Code Behind
            List<Location> locations = new List<Location>();           
    locations.Add(new Location(48.139126, 11.580186){ Description="Munich"});
                locations.Add(new Location(52.5166667, 13.4){ Description="Berlin"});
    item1.ItemsSource = locations;

    Hope this will help.

    Best wishes,
    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.
Back to Top