DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

Event: EventActionDel for XTable

Event: EventActionDel for XTable

Triggers in user dialog boxes when <Del> is pressed in the extended table.

The XTable control links default behavior to <Del>. For example, the text in a textbox is deleted automatically from the extended table when <Del> is pressed. You can use the EventActionDel event to modify this behavior: Set the parameter BDone = TRUE to disable the default behavior.

EventActionDel(ByRef This, ByRef BDone)
This Object that triggers this event.
BDone Specifies whether, when <Del> is pressed, the default behavior of the XTable control is to be reestablished after the event is executed.
Note  The event is not called in the entry mode of a cell. In this case the behavior cannot be modified.

The following example checks whether cells are selected in the XTable1 extended table. If so, the example assigns the value NoValue to the selected cells in the first selected column. Otherwise, the default behavior of the extended table and the enabled cell is deleted.

Sub XTable1_EventActionDel(ByRef This, ByRef bDone)
  If This.SelectedElements.Count = 1 Then
    Dim MySel: Set MySel = This.SelectedElements.Item(1)
    Dim i, oMyChannel
    Set oMyChannel = Data.Root.ActiveChannelGroup.Channels(MySel.FirstCol)
    For i = MySel.FirstRow To MySel.LastRow
      oMyChannel.Values(i) = NoValue 
    Next
    Call This.Refresh
    BDone = TRUE
  Else
    BDone = FALSE
  End If
End Sub

Sub XTable1_EventValGet(ByRef This, Row, Col, ByRef Cell, IsInputCell)
  If Row = 0 Then
    If Col <> 0 Then
      Cell.Text = ChnName(Col)
    Else
      Cell.Text = ""
    End If
  Else
    Select Case Col
    Case 0
      Cell.Text = Row
    Case Else
      Cell.Text = Str(Data.Root.ActiveChannelGroup.Channels(Col).Values(Row))
    End Select 
  End If
End Sub
In This Section
Was this information helpful?