The ExG2Host is an extension of the ExG2antt ( Exontrol's Grid-Gantt component ) with full database support ( ADO, DAO, XML). In other words, the ExG2Host loads and saves automatically the host's data (including the hierarchy) to one or more databases. You can map a data field from the data-source, to a property of one object in the host/gantt control, and the control automatically updates the field when it is required.
The following VB sample displays a message box, before pressing the Delete key, and cancel the operation if user selects No or Cancel:
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
If (EventID = exHostKeyDown) Then
If (vbKeyDelete = CInt(G2Host1.HostEventParam(0))) Then
If Not (MsgBox("Do you want to delete?", vbYesNoCancel) = vbYes) Then
G2Host1.HostEventParam(0) = 0
You can disable completely deletion by removing the exHostAllowDelete
flag from the HostReadOnly property.