HeaderPane
Main
Hide
Share Link
Print

EditSetup Event, SftTree Class

Occurs when a cell is about to be edited and a control must be positioned over the cell for editing purposes.

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

Syntax

public event EditSetupEventHandler EditSetup;
Public Event EditSetup As EditSetupEventHandler

Comments

Occurs when a cell is about to be edited and a control must be positioned over the cell for editing purposes.

This event makes a control available for cell editing. The control's display attributes and contents must be fully initialized by this event and additional final customizations can be performed. For example, when a combo box is used, this event can drop down the dropdown portion of the combo box control.

Once the control is positioned, visible and enabled and the EditSetup event ends, cell editing has started. The control's event handlers such as KeyDown and KeyPress can be used to implement cell navigation using the EditNavigate method.

The EditSetup event should not be used to otherwise manipulate or update the tree control in any way.

Examples

C#

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

        private void sftTree1_EditSetup(object sender, Softelvdm.SftTreeNET.EditSetupEventArgs e) {
            DumpValues("EditSetup", e);

            textBox1.Parent = sftTree1;     // make the tree control the parent window

            textBox1.Text = e.Cell.Text;
            int h = textBox1.Height;

            Rectangle r = e.rCell;
            // limit the control to the right pane - all cell editing takes place in right pane

VB.NET

    End If

    ' hide the text box and make the form the control's parent
    TextBox1.Visible = False
    TextBox1.Enabled = False
    TextBox1.Parent = SftTree1.Parent
End Sub

Private Sub SftTree1_EditSetup(ByVal sender As System.Object, ByVal e As Softelvdm.SftTreeNET.EditSetupEventArgs) Handles SftTree1.EditSetup
    DumpValues("EditSetup", e)

    TextBox1.Parent = SftTree1     ' make the tree control the parent window

    TextBox1.Text = e.Cell.Text
    Dim h As Integer = TextBox1.Height

See Also SftTree Class | Classes | SftTree/NET 3.0