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

problem in treeview

1 Answer 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
naga kiran
Top achievements
Rank 1
naga kiran asked on 20 Aug 2009, 01:11 PM

 

 


I build a list as itemsource for treeview.  i am able to see the child items but not able to see the  header of the Parent elements.
Here posting my code:

page.xaml:
--------------

<
telerikNavigation:RadTreeView x:Name="radTreeView" Grid.Row="1" >

 

 

 

<telerikNavigation:RadTreeView.ItemTemplate>

 

 

 

<core:HierarchicalDataTemplate x:Name="datatemplate" ItemsSource="{Binding DataPoints}">

 

 

 

<TextBlock Text="{Binding DisplayName}"/>

 

 

 

</core:HierarchicalDataTemplate>

 

 

 

</telerikNavigation:RadTreeView.ItemTemplate>

 

 

 

</telerikNavigation:RadTreeView>

page.xaml.cs:
------------------------
radtreeview.itemsSource=data; //include the child list object(DataPoints) in this  object

 

1 Answer, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 21 Aug 2009, 10:56 AM
Hi naga,

If you are not able to see the headers of your parent elements this must be caused by binding to an incorrect value in your HierarchicalDataTemplate. From the code snippet you posted I see that you are binding the TextBox element that is going to be rendered as the header of the parent treeview items is bound to a property called "DisplayName". Does this property exist?

Kind regards,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
naga kiran
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Share this question
or