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

rowstyle isexpandable

2 Answers 134 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Tim Ge
Top achievements
Rank 1
Tim Ge asked on 27 Apr 2011, 04:44 AM
Hi,

I have set up a rowstyle for my radtreelistview,
however, the rows without any children are still displayed without the expand arrow infront of them

the reason for this is because I have implemented the loadondemand or lazy loading function using MVVM in the control
in order to make all the rows expandable, i have put a dummy child in each row's view model object
however, this throws me object not initialised error when I tried to filter the rows

the code below describe how i set up the rowstyle

<telerik:RadTreeListView.RowStyle>
    <Style TargetType="{x:Type telerik:TreeListViewRow}">
        <Setter Property="IsExpandable" Value="True" />
        <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
        <Setter Property="FontWeight" Value="Normal" />
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="FontWeight" Value="Bold" />
            </Trigger>
        </Style.Triggers>
    </Style>
</telerik:RadTreeListView.RowStyle>


please can you advise what was wrong? note I don't want to set IsExpandable as shown in the treelistview loadondemand demon as I'm using MVVM and want to keep the code behind clean

btw, I'm using radcontrol q1 2011

Cheers

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 27 Apr 2011, 03:58 PM
Hello,

 Binding to both properties (IsExpandable and IsExpanded) is not supported currently - you can check this thread for more info. You can still use similar to our on demand demo logic with MVVM if you create custom attached behavior - for example like this demo

Both the forum thread and the demo are for Silverlight however in WPF the situation is exactly the same. 

Kind regards,
Vlad
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
0
Tim Ge
Top achievements
Rank 1
answered on 28 Apr 2011, 04:27 AM
Thanks for the reply,
so looking forward for the performance optimization in q2 2011
Tags
TreeListView
Asked by
Tim Ge
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Tim Ge
Top achievements
Rank 1
Share this question
or