HeaderPane
Main
Hide
Share Link
Print

Edit Method, CellClass Class

Edits this cell.

Class: CellClass
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public bool Edit();
Public Function Edit() As Boolean

Return Value

True if the cell editing has started for this cell, otherwise False.

Comments

Edits this cell.

Only cells in the item area can be edited. Cells in the header area, footer area or row headers cannot be edited.

Cell editing is initiated by the subsequent EditSetup event which is used to position and initialize the control used for cell editing.

The Edit method cannot edit a cell whose CellClass.EditIgnore or ItemClass.EditIgnore properties have marked the cell as non-editable or if the EditAllowed event indicates that the cell cannot be reached during cell editing.

Edit returns False, if a cell is already being edited and the EditValidate event indicated that the contents are invalid, or if the EditAllowed event for this cell indicated that editing is not allowed, or if the EditSetup event did not return a control in the EditControl field of the event's EditSetupEventArgs instance.

Examples

C#

        private void sftTree1_HorizontalOffsetChanged(object sender, Softelvdm.SftTreeNET.HorizontalOffsetChangedEventArgs e) {
            DumpValues("HorizontalOffsetChanged", e);
        }

        private void sftTree1_ItemClick(object sender, Softelvdm.SftTreeNET.ItemClickEventArgs e) {
            DumpValues("ItemClick", e);

            if (e.Item != null && e.Cell != null && e.Item.UsageLocation == UsageLocationEnum.items && e.Cell.ColumnIndex == 2)
                e.Cell.Edit();  // Start cell editing

        }

        private void sftTree1_ItemCollapsed(object sender, Softelvdm.SftTreeNET.ItemCollapsedEventArgs e) {
            DumpValues("ItemCollapsed", e);
        }

VB.NET

    DumpValues("HorizontalOffsetChanged ", e)
End Sub

Private Sub SftTree1_ItemClick(ByVal sender As System.Object, ByVal e As Softelvdm.SftTreeNET.ItemClickEventArgs) Handles SftTree1.ItemClick
    DumpValues("ItemClick", e)

        If Not e.Item Is Nothing And Not e.Cell Is Nothing Then
            If e.Item.UsageLocation = UsageLocationEnum.items And e.Cell.ColumnIndex = 2 Then
                e.Cell.Edit()  ' Start cell editing
            End If
        End If
End Sub

Private Sub SftTree1_ItemCollapsed(ByVal sender As System.Object, ByVal e As Softelvdm.SftTreeNET.ItemCollapsedEventArgs) Handles SftTree1.ItemCollapsed
    DumpValues("ItemCollapsed", e)
End Sub

See Also CellClass Class | Classes | SftTree/NET 3.0