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

RadTreeViewItem and mapNamespace:Location

1 Answer 26 Views
This is a migrated thread and some comments may be shown as answers.
Roland Ackermann
Top achievements
Rank 1
Roland Ackermann asked on 12 Mar 2010, 06:29 PM
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.























1 Answer, 1 is accepted

Sort by
Telerik team
answered on 16 Mar 2010, 10:56 AM
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.
Asked by
Roland Ackermann
Top achievements
Rank 1
Answers by
Telerik team
Share this question