Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

EditEnded Event, SftTree Object

Cell editing has ended.

Syntax

VB.NETPrivate Sub object_EditEnded(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.EditEnded
VBPrivate Sub object_EditEnded(ByVal Accepted As Boolean, ByVal ItemIndex As Long, ByVal ColIndex As Integer)
C#.NETvoid object_EditEnded(object sender, EventArgumentType e);
VC++void OnEditEndedobject(VARIANT_BOOL Accepted, long ItemIndex, short ColIndex);
CHRESULT OnEditEndedobject(VARIANT_BOOL Accepted, long ItemIndex, short ColIndex);

object

A SftTree object.

Accepted

True if cell editing was ended by the used by accepting the input data of the last cell being edited, False otherwise.

EditIndex

The zero-based index of the last item being edited. 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.

Comments

The EditEnded event occurs when cell editing has ended.

The EditEnded event occurs once cell editing has completely ended. If the user is editing a cell and uses cell navigation to edit another cell or clicks on another cell for editing purposes, the EditEnded event does not occur.

The EditEnded event can be used to validate multiple interrelated cells after cell editing has been completed or to prevent a user from exiting cell editing prematurely. If a cell is incomplete or invalid, cell editing can be restarted using the Cell.Edit method.

Examples

VB.NET

    End Sub

    Private Sub AxSftTree1_EditEnding(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_EditEndingEvent) Handles AxSftTree1.EditEnding
        Dim ctrl As Control = e.vData
        ctrl.Visible = False
        ctrl.Enabled = False
    End Sub

    Private Sub AxSftTree1_EditEnded(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_EditEndedEvent) Handles AxSftTree1.EditEnded
        Timer1.Enabled = True ' restart the spinning globe
    End Sub

End Class

VB6

Private Sub SftTree1_EditValidate(ByVal Window As stdole.OLE_HANDLE, ByVal vData As Variant, ByVal EditIndex As Long, ByVal EditCol As Integer, InputValid As Boolean)
    If Edit1.Text <> SftTree1.Cell(EditIndex, EditCol).Text Then
        MsgBox ("This example doesn't preserve the changes you make, " & _
        "because the sample data is randomly generated.")
    End If
End Sub

Private Sub SftTree1_EditEnded(ByVal Accepted As Boolean, ByVal ItemIndex As Long, ByVal ColIndex As Integer)
    Timer1.Enabled = True ' restart the spinning globe
End Sub

C#

        }

        private void axSftTree1_EditEnding(object sender, AxSftTreeLib75._DSftTreeEvents_EditEndingEvent e) {
            Control ctrl = (Control) e.vData;
            ctrl.Visible = false;
            ctrl.Enabled = false;
        }

        private void axSftTree1_EditEnded(object sender, AxSftTreeLib75._DSftTreeEvents_EditEndedEvent e) {
            Timer1.Enabled = true; // restart the spinning globe
        }

    }
}

C++

{
    // Validate the new cell contents
    CString str;
    m_Edit1.GetWindowText(str);
    if (str != (LPCTSTR) m_vTree->Cell[EditIndex][EditCol]->Text)
        AfxMessageBox(_T("This example doesn't preserve the changes you make, because the sample data is randomly generated."));
}

void CVirtualDlg::OnEditEndedSftTree1(BOOL Accepted, long ItemIndex, short ColIndex)
{
    SetTimer(TIMER_ID, 100, NULL); // restart world timer again
}

BEGIN_EVENTSINK_MAP(CVirtualDlg, CDialog)
    //{{AFX_EVENTSINK_MAP(CVirtualDlg)
    ON_EVENT(CVirtualDlg, IDC_SFTTREE1, 4 /* ItemClick */, OnItemClickSftTree1, VTS_I4 VTS_I2 VTS_I2 VTS_I2 VTS_I2)

See Also SftTree Object | Object Hierarchy


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