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

How to change expander style

1 Answer 88 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Evgeny Vdovin
Top achievements
Rank 1
Evgeny Vdovin asked on 02 Feb 2011, 08:59 PM
Hi 

How can I change expander style on TreeView
I use load on demand to load my treeview items.
Please see attach image:
What I want to do is:
1. Remove the expander ( tri-angle) from Commodity 2 and Commodity 4, but keep the expanders of others, as Commodity 2 and 4 are not expandable.

Is there a way to do it (using binding) ? Please give me an example.

Regards,
Evgeny Vdovin

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 07 Feb 2011, 03:31 PM
Hello Evgeny Vdovin,

Please examine the attached solution where you can find a basic approach following your requirement. Basically, you can set IsLoadOnDemandEnabled = true on the RadTreeView but you can set this property to false on specific RadTreeViewitems like so:
<telerik:RadTreeView x:Name="radTreeView" 
                            Margin="8"
                            IsLineEnabled="True"
                            IsLoadOnDemandEnabled="true"
                            LoadOnDemand="radTreeView_LoadOnDemand">
           <telerik:RadTreeViewItem Header="Sport Categories" IsExpanded="True">
               <telerik:RadTreeViewItem Header="Football" IsLoadOnDemandEnabled="False" />
               <telerik:RadTreeViewItem Header="Tennis" />
               <telerik:RadTreeViewItem Header="Formula 1" IsLoadOnDemandEnabled="False" />
               <telerik:RadTreeViewItem Header="Cycling" />
           </telerik:RadTreeViewItem>
       </telerik:RadTreeView>
When the treeview is bound to object ( hierarchy of objects), your business item could expose a property ( for example called LoadOnDemand) and you can bind this property to the IsLoadOnDemandEnabled property of the RadTreeViewItem using container bindings. You can find both approaches in the attached samples. Feel free to ask if you need further assistance.

All the best,
Petar Mladenov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
TileView
Asked by
Evgeny Vdovin
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or