private void AttributeTree_ValidateLabelEdit(object sender, ValidateLabelEditEventArgs e)
 {
     if (string.IsNullOrEmpty(e.Label.Trim()))
     {
         e.Cancel = true;
     }
 }
Exemple #2
0
        protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
        {
            this.LabelEdit = false;
            e.CancelEdit   = true;
            if (e.Label == null)
            {
                return;
            }
            ValidateLabelEditEventArgs ea = new ValidateLabelEditEventArgs(e.Label);

            OnValidateLabelEdit(ea);
            if (ea.Cancel == true)
            {
                e.Node.Text    = editedLabel;
                this.LabelEdit = true;
                e.Node.BeginEdit();
            }
            else
            {
                base.OnAfterLabelEdit(e);
            }
        }
Exemple #3
0
 protected virtual void OnValidateLabelEdit(ValidateLabelEditEventArgs e)
 {
     ValidateLabelEdit(this, e);
 }