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.
Unfortunately, activation email could not send to your email. Please try again.

TreeViewAdv Readonly

Thread ID:

Created:

Updated:

Platform:

Replies:

65793 Jul 27,2007 07:04 AM Aug 3,2007 05:13 AM General Discussion 1
loading
Tags: General Discussion
KJLIM
Asked On July 27, 2007 07:04 AM

Hi,

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

Jeba S [Syncfusion]
Replied On August 3, 2007 05:13 AM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;