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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

73656 May 14,2008 03:23 AM May 15,2008 06:31 AM Windows Forms 1
loading
Tags: Test Studio
Administrator [Syncfusion]
Asked On May 14, 2008 03:23 AM

Hi,

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,

Sekaran


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

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:

http://websamples.syncfusion.com/samples/Tools.Windows/Tools_Windows_TreeviewEdit/main.htm

Please try this and let me know if this helps.

Thanks,
Melba



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.

;