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

TreeListView : Expanded/Collpased Event

4 Answers 98 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
neha
Top achievements
Rank 1
neha asked on 14 Jun 2011, 09:22 AM
Hello,

I need help regarding the TreeListView's Expand/Collpase event. I am unable to capture these events  when i click on the expander.

The code is as follows:-

WPF XAML File:-

  <telerik:RadTreeListView x:Name="radTreeListView" telerik:StyleManager.Theme="Windows7"
                                 AutoGenerateColumns="False" RowIndicatorVisibility="Collapsed" 
                                 ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                 TreeViewItem.Collapsed="radTreeListView_Collapsed"
                                 TreeViewItem.Expanded="radTreeListView_Expanded" >
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding TopLevelObjects}"/>
            </telerik:RadTreeListView.ChildTableDefinitions>
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding LHS}"
                                   Header="Name"/>
           
            </telerik:RadTreeListView.Columns>
        </telerik:RadTreeListView>

The two function radTreeListView_Collapsed(..) & radTreeListView_Expanded(..) are not getting called.


Thanks,
Neha

4 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 14 Jun 2011, 09:27 AM
Hi,

 There are no such events in RadTreeListView! To achieve your goal you should use RowIsExpandedChanged. 

Greetings,
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
Manishkumar
Top achievements
Rank 1
answered on 15 Oct 2011, 06:35 AM
Hi,
But how to know whether the row is expanded or collapsed ?
0
Michael
Top achievements
Rank 1
answered on 13 Aug 2019, 02:53 PM
I would like to know if row is expanded or collapsed as well.  8 years later.
0
Martin Ivanov
Telerik team
answered on 16 Aug 2019, 08:45 AM

Hello Michael,

To achieve your requirement, you can use the RowIsExpandedChanged event of RadTreeListView. Then get the row from the event arguments and check its IsExpanded property. Here is an example in code:

private void RadTreeListView_RowIsExpandedChanged(object sender, Telerik.Windows.Controls.GridView.RowEventArgs e)
{
	var row = e.Row as Telerik.Windows.Controls.TreeListView.TreeListViewRow;
	var isExpanded = row.IsExpanded;
}

Regards, Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TreeListView
Asked by
neha
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Manishkumar
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or