Home Forums WinForms controls Other WinForms controls Double click to expand in treeview Reply To: Double click to expand in treeview

User (Old forums)
Member
Post count: 23064

Of course you can. Subcribe the ItemDoubleClick event and us
following code…

C#

private void FaTree_ItemDoubleClick(object sender, Xceed.SmartUI.SmartItemEventArgs e )
{

if (( ( Xceed.SmartUI.Controls.TreeView.Node )e.Item).Expanded == true)
( ( Xceed.SmartUI.Controls.TreeView.Node )e.Item).Expanded = false;
else
( ( Xceed.SmartUI.Controls.TreeView.Node )e.Item).Expanded = true;
}

VB.NET

Private Sub FaTree_ItemDoubleClick(ByVal sender As Object, ByVal e As Xceed.SmartUI.SmartItemEventArgs) Handles FaTree.ItemDoubleClick

If CType(e.Item, Xceed.SmartUI.Controls.TreeView.Node).Expanded = True Then
CType(e.Item, Xceed.SmartUI.Controls.TreeView.Node).Expanded = False
Else
CType(e.Item, Xceed.SmartUI.Controls.TreeView.Node).Expanded = True
End If
End Sub

Imported from legacy forums. Posted by Fatih Cem (had 3198 views)