I need to disable doubleclick behaviour and make treeview open only by clicking an indicator. Is there a way to do that?
And yet. Is there a way to subscribe to doubleclick event? I don't see corresponding event in tree.
Thank you.
Hi dprosko!
It is possible to create own class, that inherits XamWebTreeItem and override OnMouseLeftButtonUp method:
public class CustomTreeItem : XamWebTreeItem { protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) { this.IsExpanded = !this.IsExpanded; }
and use it instead XamWebTreeItem in XamWebTree:
<igTree:XamWebTree x:Name="xTree"> <local:CustomTreeItem x:Name="TestItem1" Header="Test Item 1" MouseLeftButtonDown="TestItem_MouseLeftButtonDown" > <igTree:XamWebTreeItem x:Name="SubItem1" Header="SubItem 1" /> </local:CustomTreeItem> <igTree:XamWebTreeItem x:Name="TestItem2" Header="Test Item 1" /> </igTree:XamWebTree>
I hope that can help :)
Best Regards!
Mihail
}
Thank you for reply but the way you suggested is not working correctly. Root nodes open when I click item header and won't open when I click expander triangle. Clicking child node makes root node to close. Sometimes other nodes are opening instead of closing/opening the node I click.
This is what I want:
My tree nodes load asynchronously and I want to disable doubleclick and make users click expander icon instead. Icon appears only when child nodes has been loaded so I want to make user wait until current node is fully populated. Is there a way to do that?