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

RadTreeListView: Double click should expand row detailer

1 Answer 24 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Abilash
Top achievements
Rank 1
Abilash asked on 22 Nov 2018, 09:28 AM

I want to know how to have a behaviour for telerik:RadTreeListView so that on double clicking on row it should show it's row retailer. 

 

My work flow is as below.
1) Row has child rows, first Double clicking on it, it should show it's child rows. After another double click it should show it's row detailer. 

2) Revers also need to work like already row detailer got opened, then on double click it should collapse it. 

3) Everything should be in MVVM not code behind please. 

 

Please provide a sample application.

 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 26 Nov 2018, 02:48 PM
Hi Abilash,

Thank you for the detailed explanation of the requirement.

There are two important steps in a possible implementation of such a requirement. The first one is to handle the double click, whereas the second one is to expand or collapse the given item. For the former requirement you can utilize the RowActivated event of RadTreeListView. It exposes the clicked row through the event arguments so having access to it you can consider the given approach for expanding or collapsing it. For example, you can manipulate the property of the data item bound to the IsExpandedBinding of the control.
private void clubsGrid_RowActivated(object sender, Telerik.Windows.Controls.GridView.RowEventArgs e)
        {
            var item = e.Row.DataContext as Club;
        }

The IsExpandedBinding is demonstrated in this help article. You can also take a look at the IsExpanded Binding WPF Demo as an example.

Since you need to keep the MVVM environment of the application intact, you can consider implementing an attached behavior or use the EventToCommandBehavior.

I hope this helps, Abilash.

Regards,
Stefan
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
Abilash
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or