Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

EditEnding Event, SftTree Object

Cell editing is ending.

Syntax

VB.NETPrivate Sub object_EditEnding(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.EditEnding
VBPrivate Sub object_EditEnding(ByVal Window As OLE_HANDLE, ByVal vData As Variant, ByVal EditIndex As Long, ByVal EditCol As Integer, ByVal SaveInput As Boolean)
C#.NETvoid object_EditEnding(object sender, EventArgumentType e);
VC++void OnEditEndingobject(OLE_HANDLE Window, const _variant_t& vData, long EditIndex, short EditCol, VARIANT_BOOL SaveInput);
CHRESULT OnEditEndingobject(OLE_HANDLE Window, VARIANT vData, long EditIndex, short EditCol, VARIANT_BOOL SaveInput);

object

A SftTree object.

Window

The window handle of the control being used for cell editing.

vData

Application-specific data provided as vData argument when Cell.Edit was called.

EditIndex

The zero-based index of the 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.

SaveInput

True if the new input data should be saved in the tree control, False otherwise. The value of SaveInput was returned by the application's EditValidate event as InputValid argument.

Comments

The EditEnding event occurs when cell editing is ending.

This event occurs every time cell editing for one cell is about to end. This event should only be used to save input data in the tree control and to hide and disable the control used for cell editing. This event should not take any other action or update the tree control in any other way. If the control is in virtual mode, the VirtualItemChanged method can be used to mark the item and cell as modified.

SftTree/OCX automatically hides and disables the control used for cell editing based (the Window handle provided in the EditInitializing event). However, many environments (including .NET) and ActiveX controls require that the application hide and disable controls explicitly.

After the EditEnding event occurs, another cell could be edited automatically as the result of cell navigation.

The EditValidate event can be used to validate the contents of the cell being edited. The EditValidate event precedes the EditEnding event.

The EditEnded event occurs once cell editing has completely ended.

Examples

VB.NET

        End If
        S = S.Trim()
        If S.Length <= 0 Then
            MessageBox.Show("Just to demonstrate data input validation, this example rejects empty cells.  Please enter some data.")
            e.inputValid = False
        End If
    End Sub

    Private Sub AxSftTree1_EditEnding(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_EditEndingEvent) Handles AxSftTree1.EditEnding
        ' Save the new cell contents
        If e.saveInput Then
            If e.vData Is Text1 Then
                AxSftTree1.get_Cell(e.editIndex, e.editCol).Text = Text1.Text
            Else
                AxSftTree1.get_Cell(e.editIndex, e.editCol).Text = Combo1.Text
            End If

VB6

    End If
    S = Trim(S)
    If Len(S) <= 0 Then
        MsgBox ("Just to demonstrate data input validation, this example rejects empty cells.  Please enter some data.")
        InputValid = False
    End If
End Sub

Private Sub SftTree1_EditEnding(ByVal Window As stdole.OLE_HANDLE, ByVal vData As Variant, ByVal EditIndex As Long, ByVal EditCol As Integer, ByVal SaveInput As Boolean)
    ' Save the new cell contents
    If SaveInput Then
        If Window = Text1.hwnd Then
            SftTree1.Cell(EditIndex, EditCol).Text = Text1.Text
        Else
            SftTree1.Cell(EditIndex, EditCol).Text = Combo1.Text
        End If

C#

                s = Combo1.Text;
            s = s.Trim();
            if (s.Length <= 0) {
                MessageBox.Show("Just to demonstrate data input validation, this example rejects empty cells.  Please enter some data.");
                e.inputValid = false;
            }
        }

        private void axSftTree1_EditEnding(object sender, AxSftTreeLib75._DSftTreeEvents_EditEndingEvent e) {
            // Save the new cell contents
            if (e.saveInput) {
                if (e.vData == Text1) {
                    axSftTree1.get_Cell(e.editIndex, e.editCol).Text = Text1.Text;
                } else {
                    axSftTree1.get_Cell(e.editIndex, e.editCol).Text = Combo1.Text;
                }

C++

        m_Combo1.GetWindowText(str);
    str.TrimLeft();
    if (str.GetLength() <= 0) {
        AfxMessageBox(_T("Just to demonstrate data input validation, this example rejects empty cells.  Please enter some data."));
        *InputValid = VARIANT_FALSE;
    }
}

void CCellEditingDlg::OnEditEndingSftTree1(long Window, const VARIANT FAR& vData, long EditIndex, short EditCol, BOOL SaveInput)
{
    // Save the new cell contents
    if (SaveInput) {
        CString str;
        if ((HWND)Window == m_Edit1.m_hWnd)
            m_Edit1.GetWindowText(str);
        else

See Also SftTree Object | Object Hierarchy


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