I want to prevent a TreeNode to be collapsed, so I do the following, in
the BeforeCollapse event:
// Verify if it is the root node
if (e.Node.Name == "0")
e.Cancel = true;
It works ok, but is there a way to not display the minus button?
Regards.
Junior.
pigeonrandle - 21 Aug 2006 14:25 GMT
Hi,
You can set the property "showplusminus" to false to hide ALL the plus
and minus signs,
HTH,
James.
> I want to prevent a TreeNode to be collapsed, so I do the following, in
> the BeforeCollapse event:
[quoted text clipped - 8 lines]
>
> Junior.
pigeonrandle - 21 Aug 2006 14:27 GMT
Hi again,
A better way to test if it is the root would be
if (e.Node == ((TreeView)sender).Nodes[0])
Cheers,
James.
> I want to prevent a TreeNode to be collapsed, so I do the following, in
> the BeforeCollapse event:
[quoted text clipped - 8 lines]
>
> Junior.
osmarjunior - 21 Aug 2006 14:34 GMT
Actually, I just wanna take off the minus button from the first node,
not from all nodes.
But your answer has taken me to another property of the TreeView:
ShowRootLines.
I set it to false, and I got what I want.
Thanks.
> Hi again,
> A better way to test if it is the root would be
[quoted text clipped - 16 lines]
> >
> > Junior.
pigeonrandle - 21 Aug 2006 14:41 GMT
In which case, i'm glad i couldn't help :o)
> Actually, I just wanna take off the minus button from the first node,
> not from all nodes.
[quoted text clipped - 24 lines]
> > >
> > > Junior.