Reputation: 327
I am developing a application in which i need to prevent collapsable behaviour of a root node in tree view. I tried using Before Select event. Is there any alternative for it?
Upvotes: 2
Views: 1281
Reputation: 34407
You need BeforeCollapse
event:
private void OnBeforeCollapse(object sender, TreeViewCancelEventArgs e)
{
if(!CanCollapse(e.Node)) e.Cancel = true;
}
It assumes you have a CanCollapse
function, which determines if node can be collapsed.
Upvotes: 3