How to limit the characters, that the user type for editing the treeNodeAdv using LabelEdit
1 Oct 2018 / 1 minute to read
This can be done using the below code snippet.
//It can be done using the following code snippet in the NodeEditorValidateString event to restrict a user from
//entering characters beyond a limit in a Label Editing.
//If the length of the node label is less than or equal 5,the editing continues or else it is canceled.
private void treeViewAdv1_NodeEditorValidateString(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvCancelableEditEventArgs e)
{
if (e.Label.Length <= 5)
e.ContinueEditing = true;
else
e.Cancel = true;
}
'It can be done using the following code snippet in the NodeEditorValidateString event to restrict a user from
'entering characters beyond a limit in a Label Editing.
'If the length of the node label is less than or equal 5,the editing continues or else it is canceled.
Private Sub treeViewAdv1_NodeEditorValidateString(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Tools.TreeNodeAdvCancelableEditEventArgs)
If e.Label.Length <= 5 Then
e.ContinueEditing = True
Else
e.Cancel = True
End If
End Sub
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page