Articles in this section
Category / Section

How to restrict the user from entering characters beyond a limit in a TreeNodeAdv's label in WinForms TreeViewAdv?

1 min read

NodeEditorValidateString event

The following code snippet in the NodeEditorValidateString event helps to restrict the user from entering characters beyond a limit in a LabelEditing.

C#

private void treeViewAdv1_NodeEditorValidateString(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvCancelableEditEventArgs e)
{
   if(e.Label.Length<=10)
      e.ContinueEditing=true;
   else
      e.Cancel=true;
}

VB

Private Sub treeViewAdv1_NodeEditorValidateString(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Tools.TreeNodeAdvCancelableEditEventArgs)
   If e.Label.Length<=10 Then
      e.ContinueEditing=True
   Else
      e.Cancel=True
   End If
End Sub

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied