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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Syncfusion Treeview controls - How to set the maximum length for Treeview Labels?

Thread ID:





73656 May 14,2008 07:23 AM UTC May 15,2008 10:31 AM UTC WinForms 1
Tags: Test Studio
Administrator [Syncfusion]
Asked On May 14, 2008 07:23 AM UTC


We are using Visual Studio 2005(C#, WINFORMS).
In our project, we are using Syncfusion treeview controls. We are facing one problem with this control. I mean, In treeview, label edit, i need to set the maximum length. It should not allow to enter the chars more than maximum length.

Can you please tell me how can i aschieve this using syncfusion treeview control?

Awaiting for your earliest reply.

Thanks and Regards,


Melba Winshia [Syncfusion]
Replied On May 15, 2008 10:31 AM UTC

Hi Sekaran,

Thank you for your interest in Syncfusion Products

You can validate the text of the label of a node with maximum length by using NodeEditorValidateString event. Please use below code snippet to achieve this:

private void treeViewAdv1_NodeEditorValidateString(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvCancelableEditEventArgs e)
//Check for Maximum length
if (e.Label.Length >= 6)
e.Cancel = true;

Please refer the sample in the below link which illustrates the above:


Please try this and let me know if this helps.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon