HeaderPane
Main
Hide
Share Link
Print

EditEnded Event, SftTree Class

Occurs when cell editing is about to end and the control used for cell editing can be destroyed.

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

Syntax

public event EditEndedEventHandler EditEnded;
Public Event EditEnded As EditEndedEventHandler

Comments

Occurs when cell editing is about to end and the control used for cell editing can be destroyed.

This event occurs every time cell editing for one cell is about to end. This event should only be used to save input data in the tree control and to hide and disable or destroy the control used for cell editing. This event should not take any other action or update the tree control in any other way.

After the EditEnded event occurs, another cell could be edited automatically as the result of cell navigation. The EditValidate event is used to validate the contents of the cell being edited. The EditValidate event precedes the EditEnded event.

Examples

C#

            e.Allowed = (e.Cell.ColumnIndex == 2); // only edit cells in column 2
        }

        private void sftTree1_EditClickOutside(object sender, Softelvdm.SftTreeNET.EditClickOutsideEventArgs e) {
            DumpValues("EditClickOutside", e);
        }

        private void sftTree1_EditEnded(object sender, Softelvdm.SftTreeNET.EditEndedEventArgs e) {
            DumpValues("EditEnded", e);

            // save the new cell text if necessary
            if (e.SaveValue)
                e.Cell.Text = textBox1.Text;

            // hide the text box and make the form the control's parent
            textBox1.Visible = false;

VB.NET

        e.Allowed = False
    End If
End Sub

Private Sub SftTree1_EditClickOutside(ByVal sender As System.Object, ByVal e As Softelvdm.SftTreeNET.EditClickOutsideEventArgs) Handles SftTree1.EditClickOutside
    DumpValues("EditClickOutside", e)
End Sub

Private Sub SftTree1_EditEnded(ByVal sender As System.Object, ByVal e As Softelvdm.SftTreeNET.EditEndedEventArgs) Handles SftTree1.EditEnded
    DumpValues("EditEnded", e)

    ' save the new cell text if necessary
    If e.SaveValue Then
        e.Cell.Text = TextBox1.Text
    End If

See Also SftTree Class | Classes | SftTree/NET 3.0