Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
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 AxSftTreeLib75._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 AxSftTreeLib75._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 AxSftTreeLib75._DSftTreeEvents_EditInitializingEvent) Handles AxSftTree1.EditInitializing

VB6

        End If
    End If
End Sub

Private Sub SftTree1_ToolTipVScroll(Text As String, ByVal ItemIndex As Long, ByVal ColIndex As Integer)
    Text = "Item " & ItemIndex & " - " & Text
End Sub

Private Sub SftTree1_EditAllowed(ByVal ItemIndex As Long, ByVal ColIndex As Integer, Allowed As Boolean)
    ' Last chance to suppress cell editing for a cell
    'If ItemIndex = 1 And ColIndex = 1 Then
    '    Allowed = False
    'End If
End Sub

Private Sub SftTree1_EditInitializing(Window As stdole.OLE_HANDLE, vData As Variant, ByVal EditIndex As Long, ByVal EditCol As Integer, LeftPix As stdole.OLE_XPOS_PIXELS, TopPix As stdole.OLE_YPOS_PIXELS, WidthPix As stdole.OLE_XSIZE_PIXELS, HeightPix As stdole.OLE_YSIZE_PIXELS)

C#

                    Img.Appearance = SftPictureImageConstants.sftImageCheckboxNo;
            }
        }

        private void axSftTree1_ToolTipVScroll(object sender, AxSftTreeLib75._DSftTreeEvents_ToolTipVScrollEvent e) {
            e.text = "Item " + e.itemIndex.ToString() + " - " + e.text;
        }

        private void axSftTree1_EditAllowed(object sender, AxSftTreeLib75._DSftTreeEvents_EditAllowedEvent e) {
            // Last chance to suppress cell editing for a cell
            //if (e.itemIndex == 1 && e.colIndex == 1)
            //    e.allowed = false;
        }

        private void axSftTree1_EditInitializing(object sender, AxSftTreeLib75._DSftTreeEvents_EditInitializingEvent e) {
            System.Windows.Forms.Control ctrl;

C++

void CCellEditingDlg::OnToolTipVScrollSftTree1(BSTR FAR* Text, long ItemIndex, short ColIndex)
{
    CString str;
    str.Format(_T("Item %ld - %s"), ItemIndex, (LPCTSTR)CString(*Text));
    *Text = str.AllocSysString();
}

void CCellEditingDlg::OnEditAllowedSftTree1(long ItemIndex, short ColIndex, BOOL FAR* Allowed)
{
    // Last chance to suppress cell editing for a cell
    //if (ItemIndex == 1 && ColIndex == 1)
    //    *Allowed = VARIANT_FALSE;
}

void CCellEditingDlg::OnEditInitializingSftTree1(long FAR* Window, VARIANT FAR* vData, long EditIndex, short EditCol, long FAR* LeftPix, long FAR* TopPix, long FAR* WidthPix, long FAR* HeightPix)
{

See Also SftTree Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2022 Softel vdm, Inc.