HeaderPane
Main
Hide
Share Link
Print

EditValidate Event, SftTree Class

Occurs when cell editing is active and new contents need to be validated.

Class: SftTree
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public event EditValidateEventHandler EditValidate;
Public Event EditValidate As EditValidateEventHandler

Comments

Occurs when cell editing is active and new contents need to be validated.

The EditValidate event occurs when editing of one cell is about to end (the user clicks outside of the current cell being edited, cell navigation is handled or if the SftTree.EndEdit(True) method is used). The EditValidate event allows the application to perform input validation. The new cell text currently contained in the control used for cell editing can be inspected and/or modified. If the text entered or selected is invalid, the Valid field of the EditValidateEventArgs instance must be set to False. This indicates that the new value cannot be accepted and cell editing is to be resumed. Setting Valid to True (default) ends cell editing. The tree control properties cannot be modified during this event. Use the EditEnded event to save the new cell contents.

Examples

C#

            // off we go!
            textBox1.BringToFront();
            textBox1.Focus();
            e.EditControl = textBox1;
        }

        private void sftTree1_EditValidate(object sender, Softelvdm.SftTreeNET.EditValidateEventArgs e) {
            DumpValues("EditValidate", e);
        }

        private void sftTree1_Enter(object sender, EventArgs e) {
            DumpValues("Enter", e);
        }

        private void sftTree1_FocusObjectChanged(object sender, EventArgs e) {
            DumpValues("FocusObjectChanged", e);

VB.NET

    TextBox1.Visible = True

    ' off we go!
    TextBox1.BringToFront()
    TextBox1.Focus()
    e.EditControl = TextBox1
End Sub

Private Sub SftTree1_EditValidate(ByVal sender As System.Object, ByVal e As Softelvdm.SftTreeNET.EditValidateEventArgs) Handles SftTree1.EditValidate
    DumpValues("EditValidate", e)
End Sub

Private Sub SftTree1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SftTree1.Enter
    DumpValues("Enter", e)
End Sub

See Also SftTree Class | Classes | SftTree/NET 3.0