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

Single Click Expand

1 Answer 87 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
MiddleTommy
Top achievements
Rank 1
MiddleTommy asked on 27 Jan 2012, 04:58 PM
I really like the single click to expand feature. I would like even more a singleclick to expand and a double click to collapse. Items that are already expanded when selected collapse. This seems wrong to me. You usually select an item to view it not collapse it.

1 Answer, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 01 Feb 2012, 03:15 PM
Hi MiddleTommy,

 I understand your requirement. You can customize the RadTreeView like so:

<telerik:RadTreeView IsExpandOnSingleClickEnabled="True" ItemClick="RadTreeView_ItemClick" x:Name="tree">
            <telerik:RadTreeViewItem Header="Item a">
                <telerik:RadTreeViewItem Header="Item b" />
            </telerik:RadTreeViewItem>
        </telerik:RadTreeView>
private void RadTreeView_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
       {
           this.tree.IsExpandOnSingleClickEnabled = true;
           if ((e.Source as Telerik.Windows.Controls.RadTreeViewItem).IsExpanded == true)
           {
               this.tree.IsExpandOnSingleClickEnabled = false;
           }
       }
Is this suitable for you?
Greetings,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TreeView
Asked by
MiddleTommy
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or