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
End If
End If
End If
End Sub
You can disable completely deletion by removing the exHostAllowDelete
flag from the HostReadOnly property.
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.
Shortly, the ExG2Host uses the ExG2antt which means that if you buy ExG2Host library you automatically get the ExG2antt control as well.
By default, the control creates an instance of ExG2antt type, and the Host property returns a reference to the newly created host. Shortly, the Host property supports all methods and properties listed here. In order to get
the bar from the cursor, you have to use the BarFromPoint property of the Chart object.
The following VB sample sample just displays the bar's key as soon as the user clicks the control:
' HostEvent event - Notifies the application once the host fires an event.
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
If (EventID = exHostClick) Then ' Click
MsgBox G2Host1.Host.Chart.BarFromPoint(-1, -1)
End If
End Sub
The following MS Access sample sample just displays the bar's key as soon as the user clicks the control:
' HostEvent event - Notifies the application once the host fires an event.
Private Sub G2Host1_HostEvent(ByVal EventID As Long)
If (EventID = exHostClick) Then ' Click
MsgBox G2Host1.Host.Chart.BarFromPoint(-1, -1)
End If
End Sub
Shortly, you need to change the OLEDropMode property of the Host object, and handle the OLEStartDrag through the HostEvent event as in any of the following samples
The following VB sample starts OLE drag and drop as soon as user clicks and drags the item (for MS Access replace EXG2HOSTLibCtl.HostEventEnum with Long):
Private Sub Form_Load()
G2Host1.Host.OLEDropMode = 1
End Sub
' HostEvent event - Notifies the application once the host fires an event.
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
If EventID = 1002 Then ' event OLEStartDrag (Data as ExDataObject, AllowedEffects as Long)
G2Host1.HostEventParam(0).SetData ("some data to be dragged")
End If
End Sub
The following VB sample displays information about the OLE Drag and Drop events (for MS Access replace EXG2HOSTLibCtl.HostEventEnum with Long):
Private Sub Form_Load()
G2Host1.Host.OLEDropMode = 1
End Sub
' HostEvent event - Notifies the application once the host fires an event.
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
' displays information about OLE Drag and Drop events such as: OLEDragOver(1000), OLEDragDrop(1001), OLEStartDrag(1002), OLECompleteDrag(1003), OLEGiveFeedback(1004) and OLESetData(1005)
If (EventID >= 1000) And (EventID <= 1005) Then
Debug.Print G2Host1.HostEventParam(-2)
End If
If EventID = 1002 Then ' event OLEStartDrag (Data as ExDataObject, AllowedEffects as Long)
G2Host1.HostEventParam(0).SetData ("some data to be dragged")
End If
End Sub
that contains the name/identifier(parameters) of the inner event. For instance, "OLEDragDrop/1001( [Object] , =1 , 0 , 0 , 18 , 121 )" indicates the OLEDragDrop event, which IDentifier is 1001, and it has 6 parameters as follows:
During the HostEvent event, you can use the HostEventParam(Parameter) to access a parameter giving its index. For instance, HostEventParam(0) gets the first-parameter (Data of ExDataObject type), while HostEventParam(1) gets the second parameter (Effect of Long type), and so on.
In conclusion, the following VB sample decodes the OLE Drag and Drop events, including their parameters (for MS Access replace EXG2HOSTLibCtl.HostEventEnum with Long):
' HostEvent event - Notifies the application once the host fires an event.
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
With G2Host1
Dim o As EXG2ANTTLibCtl.ExDataObject
Select Case EventID
Case 1000 ' event OLEDragOver (Data as ExDataObject, Effect as Long, Button as Integer, Shift as Integer, X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS, State as Integer)
Debug.Print "OLEDragOver"
Set o = .HostEventParam(0)
Debug.Print " Data: ", o.GetData(1)
Debug.Print " Effect: ", .HostEventParam(1)
Debug.Print " Button: ", .HostEventParam(2)
Debug.Print " Shift: ", .HostEventParam(3)
Debug.Print " X: ", .HostEventParam(4)
Debug.Print " Y: ", .HostEventParam(5)
Debug.Print " State: ", .HostEventParam(6)
Case 1001 ' event OLEDragDrop (Data as ExDataObject, Effect as Long, Button as Integer, Shift as Integer, X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS)
Debug.Print "OLEDragDrop"
Set o = .HostEventParam(0)
Debug.Print " Data: ", o.GetData(1)
Debug.Print " Effect: ", .HostEventParam(1)
Debug.Print " Button: ", .HostEventParam(2)
Debug.Print " Shift: ", .HostEventParam(3)
Debug.Print " X: ", .HostEventParam(4)
Debug.Print " Y: ", .HostEventParam(5)
Case 1002 ' event OLEStartDrag (Data as ExDataObject, AllowedEffects as Long)
Debug.Print "OLEStartDrag"
Set o = .HostEventParam(0)
Debug.Print " Data: ", o.Files.Count
Debug.Print " AllowedEffects: ", .HostEventParam(1)
o.SetData ("some data to be dragged")
Case 1003 ' event OLECompleteDrag (Effect as Long)
Debug.Print "OLECompleteDrag"
Debug.Print " Effect: ", .HostEventParam(0)
Case 1004 ' event OLEGiveFeedback (Effect as Long, DefaultCursors as Boolean)
Debug.Print "OLEGiveFeedback"
Debug.Print " Effect: ", .HostEventParam(0)
Debug.Print " DefaultCursors: ", .HostEventParam(1)
Case 1005 ' event OLESetData (Data as ExDataObject, Format as Integer)
Debug.Print "OLESetData"
Set o = .HostEventParam(0)
Debug.Print " Data: ", o.Files.Count
Debug.Print " Format: ", .HostEventParam(1)
End Select
End With
End Sub
The solution is to handle the HostEvent and monitor the exHostOffsetChanged and exHostDateChange events for the host. Once any of these occur you should update the ScrollPos and Chart.FirstVisibleDate properties.
The following sample uses the Layout property to update these properties at once (see bellow for MS Access):
Dim iLayout As Long
Private Function getLayout(ByVal G As EXG2HOSTLibCtl.G2Host)
With G.Host
getLayout = "HScroll=" & .ScrollPos(False) & vbCrLf
getLayout = getLayout & "VScroll=" & .ScrollPos(True) & vbCrLf
getLayout = getLayout & "Chart.FirstVisibleDate=#" & .Chart.FirstVisibleDate & "#" & vbCrLf
End With
End Function
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
'Debug.Print G2Host1.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange) Then
iLayout = iLayout + 1
If (iLayout = 1) Then G2Host2.Host.Layout = getLayout(G2Host1)
iLayout = iLayout - 1
End If
End Sub
Private Sub G2Host2_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
'Debug.Print G2Host2.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange) Then
iLayout = iLayout + 1
If (iLayout = 1) Then G2Host1.Host.Layout = getLayout(G2Host2)
iLayout = iLayout - 1
End If
End Sub
Private Sub Form_Load()
iLayout = 0
End Sub
The iLayout variable ensures that no recursively call occurs. The sample uses the Layout property, which saves or restores the control's UI layout. The same could be done if you call the ScrollPos or Chart.FirstVisibleDate separately as follows:
Dim iLayout As Long
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
'Debug.Print G2Host1.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange) Then
iLayout = iLayout + 1
If (iLayout = 1) Then
With G2Host2.Host
.ScrollPos(True) = G2Host1.Host.ScrollPos(True)
.ScrollPos(False) = G2Host1.Host.ScrollPos(False)
.Chart.FirstVisibleDate = G2Host1.Host.Chart.FirstVisibleDate
End With
End If
iLayout = iLayout - 1
End If
End Sub
Private Sub G2Host2_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
'Debug.Print G2Host2.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange) Then
iLayout = iLayout + 1
If (iLayout = 1) Then
With G2Host1.Host
.ScrollPos(True) = G2Host2.Host.ScrollPos(True)
.ScrollPos(False) = G2Host2.Host.ScrollPos(False)
.Chart.FirstVisibleDate = G2Host2.Host.Chart.FirstVisibleDate
End With
End If
iLayout = iLayout - 1
End If
End Sub
The sample can be changed to syncronize the UI layout of both controls, as follows:
Dim iLayout As Long
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
'Debug.Print G2Host1.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange Or EventID = exHostChartEndChanging) Then
iLayout = iLayout + 1
If (iLayout = 1) Then G2Host2.Host.Layout = G2Host1.Host.Layout
iLayout = iLayout - 1
End If
End Sub
Private Sub G2Host2_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
'Debug.Print G2Host2.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange Or EventID = exHostChartEndChanging) Then
iLayout = iLayout + 1
If (iLayout = 1) Then G2Host1.Host.Layout = G2Host2.Host.Layout
iLayout = iLayout - 1
End If
End Sub
Private Sub Form_Load()
iLayout = 0
End Sub
The following sample uses the Layout property to update these properties at once (MS Access):
Dim iLayout As Long
Private Function getLayout(ByVal G As Object)
With G.Host
getLayout = "HScroll=" & .ScrollPos(False) & vbCrLf
getLayout = getLayout & "VScroll=" & .ScrollPos(True) & vbCrLf
getLayout = getLayout & "Chart.FirstVisibleDate=#" & .Chart.FirstVisibleDate & "#" & vbCrLf
End With
End Function
Private Sub G2Host1_HostEvent(ByVal EventID As Long)
'Debug.Print G2Host1.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange) Then
iLayout = iLayout + 1
If (iLayout = 1) Then
With G2Host2.Host
.Layout = getLayout(G2Host1.Object)
End With
End If
iLayout = iLayout - 1
End If
End Sub
Private Sub G2Host2_HostEvent(ByVal EventID As Long)
'Debug.Print G2Host2.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange) Then
iLayout = iLayout + 1
If (iLayout = 1) Then
With G2Host1.Host
.Layout = getLayout(G2Host2.Object)
End With
End If
iLayout = iLayout - 1
End If
End Sub
Private Sub Form_Load()
iLayout = 0
End Sub
The iLayout variable ensures that no recursively call occurs. The sample uses the Layout property, which saves or restores the control's UI layout. The same could be done if you call the ScrollPos or Chart.FirstVisibleDate separately as follows:
Dim iLayout As Long
Private Sub G2Host1_HostEvent(ByVal EventID As Long)
'Debug.Print G2Host1.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange) Then
iLayout = iLayout + 1
If (iLayout = 1) Then
With G2Host2.Host
.ScrollPos(True) = G2Host1.Host.ScrollPos(True)
.ScrollPos(False) = G2Host1.Host.ScrollPos(False)
.Chart.FirstVisibleDate = G2Host1.Host.Chart.FirstVisibleDate
End With
End If
iLayout = iLayout - 1
End If
End Sub
Private Sub G2Host2_HostEvent(ByVal EventID As Long)
'Debug.Print G2Host2.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange) Then
iLayout = iLayout + 1
If (iLayout = 1) Then
With G2Host1.Host
.ScrollPos(True) = G2Host2.Host.ScrollPos(True)
.ScrollPos(False) = G2Host2.Host.ScrollPos(False)
.Chart.FirstVisibleDate = G2Host2.Host.Chart.FirstVisibleDate
End With
End If
iLayout = iLayout - 1
End If
End Sub
The sample can be changed to syncronize the UI layout of both controls, as follows:
Dim iLayout As Long
Private Sub G2Host1_HostEvent(ByVal EventID As Long)
'Debug.Print G2Host1.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange Or EventID = exHostChartEndChanging) Then
iLayout = iLayout + 1
If (iLayout = 1) Then G2Host2.Host.Layout = G2Host1.Host.Layout
iLayout = iLayout - 1
End If
End Sub
Private Sub G2Host1_Updated(Code As Integer)
End Sub
Private Sub G2Host2_HostEvent(ByVal EventID As Long)
'Debug.Print G2Host2.HostEventParam(-2) ' displays information about the event
If (EventID = exHostOffsetChanged Or EventID = exHostDateChange Or EventID = exHostChartEndChanging) Then
iLayout = iLayout + 1
If (iLayout = 1) Then G2Host1.Host.Layout = G2Host2.Host.Layout
iLayout = iLayout - 1
End If
End Sub
Private Sub Form_Load()
iLayout = 0
End Sub
The Layout property saves or loads the control's UI layout, such as positions of the columns, scroll position, filtering values.
The HostEvent(exHostCreateBar) event is fired once the user creates a new task. The HostEventParam(0) defines the item that hosts the newly created bar. The HostDef(exNewTaskID) property gets the identifier of the key being newly created. For instance, the following sample changes properties of the newly created bar such as exBarColor:
Private Sub G2Host1_HostEvent(ByVal EventID As Long)
If (EventID = exHostCreateBar) Then
'MsgBox G2Host1.HostEventParam(-2) ' displays information about the event
With G2Host1
Dim item As Long, key As Variant
item = .HostEventParam(0)
key = .HostDef(exNewTaskID)
.HostDef(exTaskName) = "Progress"
.Host.Items.AddBar item, .HostDef(exTaskName), .HostEventParam(1), .HostEventParam(2), key
.Host.Items.ItemBar(item, key, 33) = RGB(0, 255, 0) ' exBarColor(33)
End With
End If
End Sub
The sample changes the bar's color (green) and type(progress) once the user creates the bar by drag and drop. The bar's color and type is saved into the database only if the exTasksColor and exTasksName options of DataField property are set as in the next sample. By default, the control automatically creates the new bar (while Host.AllowCreateBar property is exCreateBarAuto) right after the HostEvent(exHostCreateBar) event. You can change this behavior by setting the Host.AllowCreateBar property to exCreateBarManual, and so you have to add the bar during the HostEvent(exHostCreateBar) event.
With G2Host1
.DataField(exTasksColor) = "Color"
.DataField(exTasksName) = "Name"
End With
The HostEvent(EventID) event occurs once the host-control (exg2antt) fires an event and before the control itself to handle the event. The HostEvent(-EventID) event (negative event) occurs once the host-control (exg2antt) fires an event and after the control itself handles the event (starting from version 19.0). Each event has different number of parameters, which is indicated by the HostEventParam(-1) property. Each parameter of the event can be accessed through the HostEventParam property. The HostEventParam(-2) gives a general information of the event. For instance, the HostEvent(-exHostCreateBar) event occurs once the user created the new-task by drag and drop. During the HostEvent(-exHostCreateBar) event you can access the newly created bar using the HostEventParam(0) that returns the handle of the item that hosts the item-bar, and HostDef(exNewTaskID) gets the key of the newly created bar.
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
If (EventID = -exHostCreateBar) Then
G2Host1.Host.Items.ItemBar(G2Host1.HostEventParam(0), G2Host1.HostDef(exNewTaskID), 33) = RGB(255, 0, 0)
End If
End Sub
The sample changes the color for the newly created bar.
The AutoSave property specifies the time in ms to perform saving, once the user changes the host. The Save method saves the control's data, while the HostDirty property is True. If no change occurs since last save, nothing will be saved.
Private Sub G2Host1_HostEvent(ByVal EventID As Long)
If (EventID = -exHostCreateBar) Then
With G2Host1
.Object.Save
MsgBox .Host.Items.ItemBar(0, "<*>", 256) & " " & .DataSource("Tasks").RecordCount
End With
End If
End Sub
The sample calls the Save method to update the changes into the associated recordset. Also, the sample displays the count of item-bars within the host and the records within the table that hosts the item-bars.
creates the bar based on the DateStart and DateEnd parameters
as in the following VB sample:
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
If (EventID = exHostCreateBar) Then
With G2Host1
.Host.Items.AddBar .HostEventParam(0), "Task", .HostEventParam(1), .HostEventParam(2)
End With
End If
End Sub
Private Sub Form_Load()
With G2Host1
.HostReadOnly = HostReadOnlyEnum.exHostAllowUpdate Or HostReadOnlyEnum.exHostAllowDelete Or HostReadOnlyEnum.exHostAllowAddNewLink Or HostReadOnlyEnum.exHostAllowAddNewItem
With .Host
.BeginUpdate
.Chart.PaneWidth(False) = 128
.Chart.AllowCreateBar = -1
With .Items
.AddItem "Item 1"
.AddItem "Item 2"
.AddItem "Item 3"
End With
.EndUpdate
End With
End With
End Sub
Next, we'll modify the code (HostEvent) to enable adding new task bars exclusively for leaf items:
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
If (EventID = exHostCreateBar) Then
With G2Host1
Dim h As Long
h = .HostEventParam(0)
If (.Host.Items.ChildCount(h) = 0) Then
.Host.Items.AddBar h, "Task", .HostEventParam(1), .HostEventParam(2)
End If
End With
End If
End Sub
The sample checks the item if contains any child items using the Items.ChildCount property
creates the bar only if the DateStart and DateEnd parameters are not the same
as in the following VB sample:
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
If (EventID = exHostCreateBar) Then
With G2Host1
Dim h As Long, s As Date, e As Date
h = .HostEventParam(0)
s = .HostEventParam(1)
e = .HostEventParam(2)
If Not (s = e) Then
.Host.Items.AddBar h, "Task", s, e
End If
End With
End If
End Sub
Private Sub Form_Load()
With G2Host1
.HostReadOnly = HostReadOnlyEnum.exHostAllowUpdate Or HostReadOnlyEnum.exHostAllowDelete Or HostReadOnlyEnum.exHostAllowAddNewLink Or HostReadOnlyEnum.exHostAllowAddNewItem
With .Host
.BeginUpdate
.Chart.PaneWidth(False) = 128
.Chart.AllowCreateBar = -1
With .Items
.AddItem "Item 1"
.AddItem "Item 2"
.AddItem "Item 3"
End With
.EndUpdate
End With
End With
End Sub
ID, is the index of the column (numeric), or a string value that specifies the caption or the key of the column to access
18, is the identifier of the exCellValueToItemBarProperty option
543, is the identifier of the exBarEndInclusive option (retrieves or sets a value that indicates the inclusive ending point of the bar. Generally, the inclusive ending point of the bar is exBarEnd - 1)
By default, a new task bar is created when the user clicks on the chart section of the control. The following sample, show how you can prevent that while bars are automatically created (by default).
In order to prevent that, you need to:
remove the last created bar if the DateStart and DateEnd parameters are the same
as in the following VB sample:
Private Sub G2Host1_HostEvent(ByVal EventID As EXG2HOSTLibCtl.HostEventEnum)
If (EventID = -exHostCreateBar) Then
With G2Host1
If (.HostEventParam(2) - .HostEventParam(1) = 0) Then
.Host.Items.RemoveBar .HostEventParam(0), .HostDef(exNewTaskID)
End If
End With
End If
End Sub
Private Sub Form_Load()
With G2Host1
With .Host
.BeginUpdate
.Chart.PaneWidth(False) = 128
With .Items
.AddItem "Item 1"
.AddItem "Item 2"
.AddItem "Item 3"
End With
.EndUpdate
End With
End With
End Sub
The HostReadOnly property allows you to retrieve or set a value of the HostReadOnlyEnum type, which includes bitwise flags to indicate the read-only status of the host. These flags define whether the host is in read-only mode, enabling flexible management of the host's read-only state based on specific configurations.
To exclude an option or flag, you cannot use the minus sign (-) as a flag operator. Instead, think of using bitwise logical operators:
AND (&): Use this when you want to combine conditions where both must be true. For example, if you want to find items that are both 1 and 4, you would use:
Example: 1 & 4 --- Only includes items where both bits are 1 (result is 0, since 0001 & 0100 = 0000).
OR (|): Use this to include options where at least one condition must be true. For instance, if you want items that are either 1 or 4, you would use:
Example: 1 | 4 --- Includes items that meet either criterion (result is 5, since 0001 | 0100 = 0101)
XOR (^): Use this to include options where you want either condition to be true but not both. If you want items that are either 1 or 4, but not both, you would use:
Example: 1 ^ 4 --- Includes items that meet one criterion but excludes those that meet both (result is 5, since 0001 ^ 0100 = 0101).
NOT (~): Use this to exclude a specific option, similar to flipping a bit to 0. If you want to include items that are 1 but not 4, you would use:
Example: 1 & ~4 --- Includes items that meet 1 and excludes any that are also 4 (result is 1, since 0001 & 1011 = 0001).
In summary, logical operators work like bitwise operators to effectively include or exclude options based on your requirements
In different programming languages, bitwise operators are used to manipulate individual bits within binary representations of numbers, but they can have different names or syntax. For example, in C/C++, Java, Python, Ruby, C#, Visual Basic 6 (VB6), and PowerBuilder, the bitwise operators for AND, OR, XOR, NOT, left shift, and right shift are represented by the symbols &, |, ^, ~, <<, and >>, respectively. In VB6, the symbols are And, Or, Xor, and Not, while it does not natively support left and right shift operations. In PowerBuilder, the operators are represented as & for AND, | for OR, and ^ for XOR. However, PowerBuilder does not support bitwise NOT, left shift, or right shift operations. While the symbols are generally consistent, it’s essential to refer to each language's documentation for specifics regarding their behavior, especially concerning signed and unsigned integers.
If you're still having difficulty working with flags, please open the ExHelper too, select "G2Host - Host Grid-Gantt ; exg2host.jsp", locate the HostReadOnly property in the control's browser, and review the options you need to include in the HostReadOnly property
By default, the control uses the AllowCellValueToItemBar feature that connects cells in a data grid (like a table) to bars in a chart or visual representation. When this feature is enabled, it allows the following:
Display of Information: Cells can show specific information, such as the start and end dates of a bar. For example, if a bar represents a project timeline, the cells might display the project's start and end dates.
Automatic Updates: When the size or position of the bar changes—like if you resize it or move it—the information in the connected cells updates automatically to reflect those changes. This ensures that the data remains consistent.
Interactive Changes: If you change the value in a cell (for instance, updating a date), the associated bar will also adjust itself. This means the bar will either resize or reposition itself based on the new value in the cell, maintaining the relationship between the two.
The Start and End columns display the margins of each single bar within an item host. These margins are specified by the Def(exCellValueToItemBarProperty) property of the column, which can include options such as exBarStart, exBarEnd, exBarName, exBarColor, and exBarCaption. For the dates to appear in the Start and End columns, the key of the bar must be empty; otherwise, no dates (or any item-bar property associated) will be shown
Yes, you can add IntelliSense for the Host property by casting it to the IG2antt interface of ExG2antt control, as demonstrated in the following VB sample. To do this, you first need to ensure that you have added a reference to the 'ExG2antt 1.0 Control Library.' You can do this by navigating to Project > References in your development environment (VB).
Dim h As EXG2ANTTLib.IG2antt
Set h = G2Host1.Host
and you can use 'h' instead of 'Host', which this time includes all the definitions of the ExG2antt control, as shown in the following picture:
Previously, you must add a reference to "ExG2antt 1.0 Control Library", using Project\References.