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

Exapnd all the Tree Nodes loading

2 Answers 56 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
smith
Top achievements
Rank 1
smith asked on 31 Aug 2009, 07:48 AM
HI

 I am using Hierarchical Data Binding  to Populate tree View. i want to show all the Tree Nodes  first time loading Itself.

dont want Load on Demand event like that . how to do
pls send example for this

2 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 31 Aug 2009, 01:20 PM
Hello smith,

If you want all items to be expanded by default you can set a style that will set their IsExpanded property to true.

If you are binding the TreeView, you will need to set the ItemContainerStyle, like so:

<Style TargetType="nav:RadTreeViewItem" x:Key="TreeViewItemStyle">
    <Setter Property="IsExpanded" Value="True" />
</Style>


<nav:RadTreeView ItemContainerStyle="{StaticResource TreeViewItemStyle}" />

where the nav namespace is:

xmlns:nav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"

Hopefully this will work in your case.

Kind regards,
Miroslav
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.
0
Christian
Top achievements
Rank 1
answered on 18 Sep 2009, 08:49 AM
Thanks Miroslav, this is just what we needed. Unfortunately the ExpandAll() method of the tree view class still does not have any effect whatsoever (RadControls 2009.2.812.1030).
Tags
TreeView
Asked by
smith
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Christian
Top achievements
Rank 1
Share this question
or