HeaderPane
Main
Hide

SftTree/OCX 8.0 - ActiveX Tree Control

Share Link
Print

EditAllowed Event, SftTree Object

Determines whether a cell can be reached during cell editing.

Syntax

VB.NETPrivate Sub object_EditAllowed(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.EditAllowed
VBPrivate Sub object_EditAllowed(ByVal ItemIndex As Long, ByVal ColIndex As Integer, Allowed As Boolean)
C#.NETvoid object_EditAllowed(object sender, EventArgumentType e);
VC++void OnEditAllowedobject(long ItemIndex, short ColIndex, VARIANT_BOOL* Allowed);
CHRESULT OnEditAllowedobject(long ItemIndex, short ColIndex, VARIANT_BOOL* Allowed);

object

A SftTree object.

EditIndex

The zero-based item index of the item to be tested for cell editing. The combination of EditIndex and EditCol describes an individual cell.

EditCol

The zero-based column number. The combination of EditIndex and EditCol describes an individual cell.

Allowed

Return True to allow editing of the specified cell, False otherwise.

Comments

The EditAllowed event determines whether a cell can be reached during cell editing.

It is called while a EditNavigate method is being processed, to determine whether a cell can be reached during cell editing. It is possible to suppress cell editing for items and cells using the Item.EditIgnore and Cell.EditIgnore properties. In addition, the EditNavigate method can be used to disallow editing of cells, even if the cell is otherwise editable.

If cell editing is suppressed for items and cells using the Item.EditIgnore and Cell.EditIgnore properties, the EditAllowed event does not occur for these items and cells.

Other than determining whether a cell can be reached during cell editing, this event should not take any other action or update the tree control in any way.

Examples

VB.NET

            End If
        End If
    End Sub

    Private Sub AxSftTree1_ToolTipVScroll(ByVal sender As Object, ByVal e As AxSftTreeLib80._DSftTreeEvents_ToolTipVScrollEvent) Handles AxSftTree1.ToolTipVScroll
        e.text = "Item " & e.itemIndex & " - " & e.text
    End Sub

    Private Sub AxSftTree1_EditAllowed(ByVal sender As Object, ByVal e As AxSftTreeLib80._DSftTreeEvents_EditAllowedEvent) Handles AxSftTree1.EditAllowed
        ' Last chance to suppress cell editing for a cell
        'If e.itemIndex = 1 And e.colIndex = 1 Then
        '    e.allowed = False
        'End If
    End Sub

    Private Sub AxSftTree1_EditInitializing(ByVal sender As Object, ByVal e As AxSftTreeLib80._DSftTreeEvents_EditInitializingEvent) Handles AxSftTree1.EditInitializing

C++

    }
}

BEGIN_EVENTSINK_MAP(CCellEditingDlg, CDialog)
    //{{AFX_EVENTSINK_MAP(CCellEditingDlg)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 4 /* ItemClick */, OnItemClickSftTree1, VTS_I4 VTS_I2 VTS_I2 VTS_I2 VTS_I2)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 5 /* ItemDblClick */, OnItemDblClickSftTree1, VTS_I4 VTS_I2 VTS_I2 VTS_I2 VTS_I2)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 28 /* ToolTipVScroll */, OnToolTipVScrollSftTree1, VTS_PBSTR VTS_I4 VTS_I2)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 44 /* EditAllowed */, OnEditAllowedSftTree1, VTS_I4 VTS_I2 VTS_PBOOL)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 38 /* EditInitializing */, OnEditInitializingSftTree1, VTS_PI4 VTS_PVARIANT VTS_I4 VTS_I2 VTS_PI4 VTS_PI4 VTS_PI4 VTS_PI4)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 39 /* EditInitialized */, OnEditInitializedSftTree1, VTS_I4 VTS_VARIANT VTS_I4 VTS_I2 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_PBOOL)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 43 /* EditNavigating */, OnEditNavigatingSftTree1, VTS_I4 VTS_I2 VTS_I4 VTS_I2)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 37 /* EditValidate */, OnEditValidateSftTree1, VTS_I4 VTS_VARIANT VTS_I4 VTS_I2 VTS_PBOOL)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 36 /* EditEnding */, OnEditEndingSftTree1, VTS_I4 VTS_VARIANT VTS_I4 VTS_I2 VTS_BOOL)
    //}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

See Also SftTree Object | Object Hierarchy


Last Updated 05/24/2026 - (email)
© 2026 Softel vdm, Inc.