We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

TreeViewAdv Readonly

Hi,

I want to set Syncfusion.Windows.Forms.Tools.TreeviewAdv into readonly, can anybody help me?

1 Reply

JS Jeba S Syncfusion Team August 3, 2007 09:13 AM UTC

Hi K.J,

Thank you for posting query to us.

Disable Editing
If your intention is to disable editing inTreeViewAdv, you can prevent editing by handling the Before Edit event and set the e.Cancel property to true.


private void treeViewAdv1_BeforeEdit(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvBeforeEditEventArgs e)
{
//Let us prevent editing the top-level nodes.
if(e.Node.Parent == this.treeViewAdv1.Root)
{
e.Cancel = true;
MessageBox.Show("Node editing canceled for top-level nodes in the BeforeEdit event handler.");
}

//Prevent editing in all nodes
e.Cancel = true;
}

Disable drag and drop
If your intention is to disable drag and drop, you can achieve this using the AllowDrop property.

this.treeViewAdv1.AllowDrop = false;


If I have misunderstood your requirement, could you please explain me in detail, so that I can work in further and try to send a better solution?

Please refer the sample in the below link and let us know if this helps.
http://websamples.syncfusion.com/samples/Tools.Windows/F65793/main.htm

Thank you for using Syncfusion Products.

Best Regards,
Jeba.

Loader.
Live Chat Icon For mobile
Up arrow icon