50
How do I get the start/end of the bar once the BarResize/BarResizing event occurs

' Notifies the application once the host fires an event.
function HostEvent as v (EventID  as  OLE::Exontrol.G2Host.1::HostEventEnum)
	Dim h as 
	Dim key as 
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	h = oG2Host.HostEventParam(0)
	key = oG2Host.HostEventParam(1)
	? oG2Host.HostEventParam(-2) 
	? "Start:" 
	? oG2Host.Host.Items.ItemBar(h,key,1) 
	? oG2Host.HostEventParam(-2) 
	? "End:" 
	? oG2Host.Host.Items.ItemBar(h,key,2) 
end function

Dim oG2Host as P
Dim var_Chart as P
Dim var_Items as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_Chart = oG2Host.Host.Chart
	' var_Chart.PaneWidth(.f.) = 128
	oG2Host.TemplateDef = "dim var_Chart"
	oG2Host.TemplateDef = var_Chart
	oG2Host.Template = "var_Chart.PaneWidth(False) = 128"

	var_Chart.FirstVisibleDate = {03/30/2019}
var_Items = oG2Host.Host.Items
	var_Items.AddBar(var_Items.AddItem("Task"),"Task",{04/01/2019},{04/14/2019})

49
How do I get the bar/task from the cursor
' Notifies the application once the host fires an event.
function HostEvent as v (EventID  as  OLE::Exontrol.G2Host.1::HostEventEnum)
	Dim b as 
	Dim i as N
	Dim var_Chart as P
	Dim var_G2antt as P
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? "Event:" 
	? oG2Host.HostEventParam(-2) 
	var_G2antt = oG2Host.Host
		i = var_G2antt.ItemFromPoint(-1,-1,c,h)
		? "Cell:" 
		? var_G2antt.Items.CellCaption(i,c) 
		var_Chart = var_G2antt.Chart
			b = var_Chart.BarFromPoint(-1,1)
			? "Bar:" 
			? oG2Host.Host.Items.ItemBar(i,b,0) 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex

48
How do I get the cell from the cursor

' Notifies the application once the host fires an event.
function HostEvent as v (EventID  as  OLE::Exontrol.G2Host.1::HostEventEnum)
	Dim i as N
	Dim var_G2antt as P
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? "Event:" 
	? oG2Host.HostEventParam(-2) 
	var_G2antt = oG2Host.Host
		i = var_G2antt.ItemFromPoint(-1,-1,c,h)
		? "Cell:" 
		? var_G2antt.Items.CellCaption(i,c) 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex

47
How can I highlights cells based on its value

Dim oG2Host as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_ConditionalFormat as local
Dim var_ConditionalFormat1 as local
Dim var_ConditionalFormats as P
Dim var_G2antt as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataField(12) = `Color`" // oG2Host.DataField(12) = "Color"
oG2Host.Template = "DataField(13) = `TaskName`" // oG2Host.DataField(13) = "TaskName"
var_G2antt = oG2Host.Host
	var_G2antt.BeginUpdate()
	var_G2antt.BackColorAlternate = 0
	var_Column = var_G2antt.Columns.Item("Title")
		' var_Column.Def(4) = 15790320
		oG2Host.TemplateDef = "dim var_Column"
		oG2Host.TemplateDef = var_Column
		oG2Host.Template = "var_Column.Def(4) = 15790320"

		var_Column.Width = var_Column.AutoWidth
	var_ConditionalFormats = var_G2antt.ConditionalFormats
		' var_ConditionalFormats.Add("lower(%4) contains `manager`").Bold = .t.
		var_ConditionalFormat = var_ConditionalFormats.Add("lower(%4) contains `manager`")
		oG2Host.TemplateDef = "dim var_ConditionalFormat"
		oG2Host.TemplateDef = var_ConditionalFormat
		oG2Host.Template = "var_ConditionalFormat.Bold = True"

		' var_ConditionalFormats.Add("%3").BackColor = 15790320
		var_ConditionalFormat1 = var_ConditionalFormats.Add("%3")
		oG2Host.TemplateDef = "dim var_ConditionalFormat1"
		oG2Host.TemplateDef = var_ConditionalFormat1
		oG2Host.Template = "var_ConditionalFormat1.BackColor = 15790320"

	' var_G2antt.Items.ExpandItem(0) = .t.
	var_Items = var_G2antt.Items
	oG2Host.TemplateDef = "dim var_Items"
	oG2Host.TemplateDef = var_Items
	oG2Host.Template = "var_Items.ExpandItem(0) = True"

	var_Column1 = var_G2antt.Columns.Item("EmployeeID")
		var_Column1.Width = var_Column1.AutoWidth
	var_G2antt.EndUpdate()

46
How do I programatically hide a column

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataField(12) = `Color`" // oG2Host.DataField(12) = "Color"
oG2Host.Template = "DataField(13) = `TaskName`" // oG2Host.DataField(13) = "TaskName"
oG2Host.Host.Columns.Item("LastName").Visible = .f.

45
Is it possible to get the information from the control when we click on the bar/item

' Notifies the application once the host fires an event.
function HostEvent as v (EventID  as  OLE::Exontrol.G2Host.1::HostEventEnum)
	Dim b as 
	Dim i as N
	Dim var_G2antt as P
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? oG2Host.HostEventParam(-2) 
	var_G2antt = oG2Host.Host
		i = var_G2antt.ItemFromPoint(-1,-1,c,hit)
		? "cell's value from cursor: " 
		? var_G2antt.Items.CellValue(i,c) 
		? "cell's value on col 1: " 
		? var_G2antt.Items.CellValue(i,1) 
		b = var_G2antt.Chart.BarFromPoint(-1,-1)
		? "Bar:" 
		? b 
		? "Bar Start:" 
		? var_G2antt.Items.ItemBar(i,b,1) 
		? "Bar End:" 
		? var_G2antt.Items.ItemBar(i,b,2) 
		? "Bar Caption:" 
		? var_G2antt.Items.ItemBar(i,b,3) 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Chart as P
Dim var_G2antt as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_G2antt = oG2Host.Host
	var_G2antt.Debug = .t.
	var_Bar = var_G2antt.Chart.Bars.Item("Task")
		var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
		var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataField(12) = `Color`" // oG2Host.DataField(12) = "Color"
oG2Host.Template = "DataField(13) = `TaskName`" // oG2Host.DataField(13) = "TaskName"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

var_Chart = oG2Host.Host.Chart
	' var_Chart.PaneWidth(.f.) = 128
	oG2Host.TemplateDef = "dim var_Chart"
	oG2Host.TemplateDef = var_Chart
	oG2Host.Template = "var_Chart.PaneWidth(False) = 128"

	var_Chart.ScrollTo({05/27/2017},1)

44
How do I get the bar from the cursor

' Notifies the application once the host fires an event.
function HostEvent as v (EventID  as  OLE::Exontrol.G2Host.1::HostEventEnum)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? oG2Host.HostEventParam(-2) 
	? oG2Host.Host.Chart.BarFromPoint(-1,-1) 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Chart as P
Dim var_G2antt as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_G2antt = oG2Host.Host
	var_G2antt.VisualAppearance.Add(1,"C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn")
	var_Bar = var_G2antt.Chart.Bars.Item("Task")
		var_Bar.Height = 15
		var_Bar.Color = 33488896
		var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
		var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataField(12) = `Color`" // oG2Host.DataField(12) = "Color"
oG2Host.Template = "DataField(13) = `TaskName`" // oG2Host.DataField(13) = "TaskName"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

var_Chart = oG2Host.Host.Chart
	' var_Chart.PaneWidth(.f.) = 128
	oG2Host.TemplateDef = "dim var_Chart"
	oG2Host.TemplateDef = var_Chart
	oG2Host.Template = "var_Chart.PaneWidth(False) = 128"

	var_Chart.ScrollTo({05/27/2017},1)

43
How do I add Start/End columns

' Notifies the application once the host fires an event.
function HostEvent as v (EventID  as  OLE::Exontrol.G2Host.1::HostEventEnum)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? oG2Host.HostEventParam(-2) 
end function

Dim oG2Host as P
Dim var_Chart as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_G2antt as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.HostReadOnly = 255 'exHostReadWrite + exHostAllowAddEmptyItem
var_G2antt = oG2Host.Host
	var_G2antt.SingleSel = .f.
	var_G2antt.OnResizeControl = 1
	var_G2antt.ScrollBars = 2058 'exVScrollEmptySpace + exDisableNoVertical
	var_Column = var_G2antt.Columns.Add("Start")
		var_Column.AllowSizing = .f.
		' var_Column.Def(18) = 1
		oG2Host.TemplateDef = "dim var_Column"
		oG2Host.TemplateDef = var_Column
		oG2Host.Template = "var_Column.Def(18) = 1"

		var_Column.Editor.EditType = 7
	var_Column1 = var_G2antt.Columns.Add("End")
		var_Column1.AllowSizing = .f.
		' var_Column1.Def(18) = 2
		oG2Host.TemplateDef = "dim var_Column1"
		oG2Host.TemplateDef = var_Column1
		oG2Host.Template = "var_Column1.Def(18) = 2"

		var_Column1.Editor.EditType = 7
	var_G2antt.Items.AllowCellValueToItemBar = .t.
	var_Chart = var_G2antt.Chart
		var_Chart.AllowCreateBar = 1
		' var_Chart.PaneWidth(.f.) = 256
		oG2Host.TemplateDef = "dim var_Chart"
		oG2Host.TemplateDef = var_Chart
		oG2Host.Template = "var_Chart.PaneWidth(False) = 256"

		var_Chart.Bars.Item("Task").OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack

42
How do I hide the left/items/columns part of the control

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Chart as P
Dim var_G2antt as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.Pattern = 1
	var_Bar.Color = 16711680
	' var_Bar.Def(19) = 50
	oG2Host.TemplateDef = "dim var_Bar"
	oG2Host.TemplateDef = var_Bar
	oG2Host.Template = "var_Bar.Def(19) = 50"

oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataField(12) = `Color`" // oG2Host.DataField(12) = "Color"
oG2Host.Template = "DataField(13) = `TaskName`" // oG2Host.DataField(13) = "TaskName"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

oG2Host.HostReadOnly = 255 'exHostReadWrite + exHostAllowAddEmptyItem
var_G2antt = oG2Host.Host
	var_G2antt.OnResizeControl = 129 'exDisableSplitter + exResizeChart
	var_Chart = var_G2antt.Chart
		var_Chart.ColumnsFormatLevel = "1"
		' var_Chart.PaneWidth(.f.) = 0
		oG2Host.TemplateDef = "dim var_Chart"
		oG2Host.TemplateDef = var_Chart
		oG2Host.Template = "var_Chart.PaneWidth(False) = 0"

		var_Chart.ScrollTo({05/27/2017},1)

41
How do I hide the right/chart/tasks part of the control

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Chart as P
Dim var_G2antt as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.Pattern = 1
	var_Bar.Color = 16711680
	' var_Bar.Def(19) = 50
	oG2Host.TemplateDef = "dim var_Bar"
	oG2Host.TemplateDef = var_Bar
	oG2Host.Template = "var_Bar.Def(19) = 50"

oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataField(12) = `Color`" // oG2Host.DataField(12) = "Color"
oG2Host.Template = "DataField(13) = `TaskName`" // oG2Host.DataField(13) = "TaskName"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

var_G2antt = oG2Host.Host
	var_Chart = var_G2antt.Chart
		' var_Chart.PaneWidth(.t.) = 0
		oG2Host.TemplateDef = "dim var_Chart"
		oG2Host.TemplateDef = var_Chart
		oG2Host.Template = "var_Chart.PaneWidth(True) = 0"

		var_Chart.OverviewVisible = 0

40
How do hide the top/overview part of the control

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Chart as P
Dim var_G2antt as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataField(7) = DataField(0)" // oG2Host.DataField(7) = oG2Host.DataField(0)
oG2Host.Template = "DataField(9) = `BirthDate`" // oG2Host.DataField(9) = "BirthDate"
oG2Host.Template = "DataField(10) = `HireDate`" // oG2Host.DataField(10) = "HireDate"
var_G2antt = oG2Host.Host
	var_Chart = var_G2antt.Chart
		var_Chart.OverviewVisible = 0
		' var_Chart.PaneWidth(.f.) = 256
		oG2Host.TemplateDef = "dim var_Chart"
		oG2Host.TemplateDef = var_Chart
		oG2Host.Template = "var_Chart.PaneWidth(False) = 256"

		var_Chart.ScrollTo({04/27/1969},1)

39
How do I resize the panels

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Chart as P
Dim var_G2antt as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_G2antt = oG2Host.Host
	var_G2antt.VisualAppearance.Add(1,"C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn")
	var_Bar = var_G2antt.Chart.Bars.Item("Task")
		var_Bar.Height = 15
		var_Bar.Color = 33488896
		var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
		var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataField(12) = `Color`" // oG2Host.DataField(12) = "Color"
oG2Host.Template = "DataField(13) = `TaskName`" // oG2Host.DataField(13) = "TaskName"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

var_Chart = oG2Host.Host.Chart
	' var_Chart.PaneWidth(.f.) = 128
	oG2Host.TemplateDef = "dim var_Chart"
	oG2Host.TemplateDef = var_Chart
	oG2Host.Template = "var_Chart.PaneWidth(False) = 128"

	var_Chart.ScrollTo({05/27/2017},1)

38
How do I lock the first column

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_G2antt as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
var_G2antt = oG2Host.Host
	var_G2antt.CountLockedColumns = 1
	var_G2antt.BackColorLock = var_G2antt.BackColorAlternate

37
How do I specify a different color for the tasks ( EBN color )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Chart as local
Dim var_G2antt as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_G2antt = oG2Host.Host
	var_G2antt.VisualAppearance.Add(1,"C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn")
	var_Bar = var_G2antt.Chart.Bars.Item("Task")
		var_Bar.Height = 15
		var_Bar.Color = 33488896
		var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
		var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataField(12) = `Color`" // oG2Host.DataField(12) = "Color"
oG2Host.Template = "DataField(13) = `TaskName`" // oG2Host.DataField(13) = "TaskName"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

' oG2Host.Host.Chart.PaneWidth(.f.) = 256
var_Chart = oG2Host.Host.Chart
oG2Host.TemplateDef = "dim var_Chart"
oG2Host.TemplateDef = var_Chart
oG2Host.Template = "var_Chart.PaneWidth(False) = 256"

oG2Host.Host.Chart.ScrollTo({05/27/2017},1)

36
How do I specify a different color for the tasks ( solid color, transparent )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Chart as local
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.Pattern = 1
	var_Bar.Color = 16711680
	' var_Bar.Def(19) = 50
	oG2Host.TemplateDef = "dim var_Bar"
	oG2Host.TemplateDef = var_Bar
	oG2Host.Template = "var_Bar.Def(19) = 50"

oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataField(12) = `Color`" // oG2Host.DataField(12) = "Color"
oG2Host.Template = "DataField(13) = `TaskName`" // oG2Host.DataField(13) = "TaskName"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

' oG2Host.Host.Chart.PaneWidth(.f.) = 256
var_Chart = oG2Host.Host.Chart
oG2Host.TemplateDef = "dim var_Chart"
oG2Host.TemplateDef = var_Chart
oG2Host.Template = "var_Chart.PaneWidth(False) = 256"

oG2Host.Host.Chart.ScrollTo({05/27/2017},1)

35
GroupBy

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Column as P
Dim var_G2antt as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataSource(`Links`) = DataSource(`Items`)" // oG2Host.DataSource("Links") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Links`) = `EmployeeLinks`" // oG2Host.DataMember("Links") = "EmployeeLinks"
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"
var_G2antt = oG2Host.Host
	var_G2antt.AllowGroupBy = .t.
	var_G2antt.SortBarVisible = .t.
	var_G2antt.BackColorSortBar = oG2Host.Host.BackColor
	var_G2antt.BackColorSortBarCaption = var_G2antt.BackColorSortBar
	var_G2antt.SortBarCaption = "<sha ;;0><fgcolor=FF0000>Drag a <b>column</b> header here to sort by that column."
	var_Bar = var_G2antt.Chart.Bars.Item("Task")
		var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
		var_Bar.OverlaidGroup = "Task,Progress"
	' var_G2antt.Items.ExpandItem(0) = .t.
	var_Items = var_G2antt.Items
	oG2Host.TemplateDef = "dim var_Items"
	oG2Host.TemplateDef = var_Items
	oG2Host.Template = "var_Items.ExpandItem(0) = True"

	var_G2antt.CountLockedColumns = 1
	var_G2antt.BackColorLock = var_G2antt.BackColorAlternate
	var_Column = var_G2antt.Columns.Item("EmployeeID")
		var_Column.AllowGroupBy = .f.
		' var_Column.Def(7) = oG2Host.Host.BackColorAlternate
		oG2Host.TemplateDef = "dim var_Column"
		oG2Host.TemplateDef = var_Column
		oG2Host.Template = "var_Column.Def(7) = Me.Host.BackColorAlternate"

	var_G2antt.Columns.Item("Title").SortOrder = 1
oG2Host.Host.Chart.ScrollTo({05/27/2017},1)

34
How can I hide a column
' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Host.Columns.Item(0).Visible = .f.

33
Can row errors being highligted until the user correct them, not to clear them as soon a change occurs

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "HostDef(7) = False" // oG2Host.HostDef(7) = .f.

32
No error is highligthed

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"

31
I've noticed that rows with errors are shown in red. Is it possible to change the colors

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "HostDef(6) = 0" // oG2Host.HostDef(6) = 0
oG2Host.Template = "HostDef(5) = 16777215" // oG2Host.HostDef(5) = 16777215

30
Is it possible to rename the (New) to something else

Dim oG2Host as P
Dim var_G2antt as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "HostDef(1) = `*`" // oG2Host.HostDef(1) = "*"
var_G2antt = oG2Host.Host
	var_G2antt.BeginUpdate()
	var_G2antt.Items.AddItem("A")
	var_G2antt.Items.AddItem("B")
	var_G2antt.EndUpdate()
oG2Host.Refresh()

29
How can I hide the (New) item (sample 2)

Dim oG2Host as P
Dim var_G2antt as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.HostReadOnly = 240 'exHostAllowUpdate + exHostAllowDelete
var_G2antt = oG2Host.Host
	var_G2antt.BeginUpdate()
	var_G2antt.Items.AddItem("A")
	var_G2antt.Items.AddItem("B")
	var_G2antt.EndUpdate()

28
How can I hide the (New) item (sample 1)

Dim oG2Host as P
Dim var_G2antt as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "HostDef(1) = ``" // oG2Host.HostDef(1) = ""
var_G2antt = oG2Host.Host
	var_G2antt.BeginUpdate()
	var_G2antt.Items.AddItem("A")
	var_G2antt.Items.AddItem("B")
	var_G2antt.EndUpdate()
oG2Host.Refresh()

27
Read-Only

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.HostReadOnly = 0

26
How can I prevent user create new /delete tasks ( only move or resize then )
' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataSource(`Links`) = DataSource(`Items`)" // oG2Host.DataSource("Links") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Links`) = `EmployeeLinks`" // oG2Host.DataMember("Links") = "EmployeeLinks"
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
	var_Bar.OverlaidGroup = "Task,Progress"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

oG2Host.HostReadOnly = 128
oG2Host.Host.Chart.ScrollTo({05/27/2017},1)

25
How do I get the row/item/task/link from the cursor

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

' Notifies the application once the host fires an event.
function HostEvent as v (EventID  as  OLE::Exontrol.G2Host.1::HostEventEnum)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? oG2Host.HostContext.ToString 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.HostReadOnly = 141 'exHostAllowUpdate + exHostAllowAddNew

24
Disable Delete
' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.HostReadOnly = 141 'exHostAllowUpdate + exHostAllowAddNew

23
Disable AddNew

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.HostReadOnly = 240 'exHostAllowUpdate + exHostAllowDelete

22
ACCDB sample ( file )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataSource(`Links`) = DataSource(`Items`)" // oG2Host.DataSource("Links") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Links`) = `EmployeeLinks`" // oG2Host.DataMember("Links") = "EmployeeLinks"
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
	var_Bar.OverlaidGroup = "Task,Progress"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

oG2Host.Host.Chart.ScrollTo({05/27/2017},1)

21
MDB sample ( file )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.mdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.mdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataSource(`Links`) = DataSource(`Items`)" // oG2Host.DataSource("Links") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Links`) = `EmployeeLinks`" // oG2Host.DataMember("Links") = "EmployeeLinks"
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
	var_Bar.OverlaidGroup = "Task,Progress"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

oG2Host.Host.Chart.ScrollTo({05/27/2017},1)

20
DBF sample ( file )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.dbf`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.dbf"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"

19
DAO sample ( object, DAO.DBEngine.120, multiple tasks, multiple tables )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim rsEmployees as P
Dim rsLinks as P
Dim rsTasks as P
Dim var_Bar as P
Dim var_Database as P
Dim var_Items as local
Dim var_PrivDBEngine as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_PrivDBEngine = OLE.Create("DAO.DBEngine.120")
	var_Database = var_PrivDBEngine.OpenDatabase("C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
		rsEmployees = var_Database.OpenRecordset("Employees")
		rsTasks = var_Database.OpenRecordset("EmployeeDetails")
		rsLinks = var_Database.OpenRecordset("EmployeeLinks")
oG2Host.Template = "DataSource(`Items`) = rsEmployees" // oG2Host.DataSource("Items") = rsEmployees
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataSource(`Tasks`) = rsTasks" // oG2Host.DataSource("Tasks") = rsTasks
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataSource(`Links`) = rsLinks" // oG2Host.DataSource("Links") = rsLinks
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
	var_Bar.OverlaidGroup = "Task,Progress"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

oG2Host.Host.Chart.ScrollTo({05/27/2017},1)

18
DAO sample ( file, multiple tasks, multiple tables )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataTechnology(`Items`) = `DAO.DBEngine.120;DAO.DBEngine.36`" // oG2Host.DataTechnology("Items") = "DAO.DBEngine.120;DAO.DBEngine.36"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataTechnology(`Tasks`) = `DAO.DBEngine.120;DAO.DBEngine.36`" // oG2Host.DataTechnology("Tasks") = "DAO.DBEngine.120;DAO.DBEngine.36"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataTechnology(`Links`) = `DAO.DBEngine.120;DAO.DBEngine.36`" // oG2Host.DataTechnology("Links") = "DAO.DBEngine.120;DAO.DBEngine.36"
oG2Host.Template = "DataSource(`Links`) = DataSource(`Items`)" // oG2Host.DataSource("Links") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Links`) = `EmployeeLinks`" // oG2Host.DataMember("Links") = "EmployeeLinks"
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
	var_Bar.OverlaidGroup = "Task,Progress"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

oG2Host.Host.Chart.ScrollTo({05/27/2017},1)

17
DAO sample ( object, DAO.DBEngine.120, single task, single table )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim rsEmployees as P
Dim rsLinks as P
Dim var_Database as P
Dim var_PrivDBEngine as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_PrivDBEngine = OLE.Create("DAO.DBEngine.120")
	var_Database = var_PrivDBEngine.OpenDatabase("C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
		rsEmployees = var_Database.OpenRecordset("Employees")
		rsLinks = var_Database.OpenRecordset("EmployeeLinks")
oG2Host.Template = "DataSource(`Items`) = rsEmployees" // oG2Host.DataSource("Items") = rsEmployees
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataField(7) = DataField(0)" // oG2Host.DataField(7) = oG2Host.DataField(0)
oG2Host.Template = "DataField(9) = `BirthDate`" // oG2Host.DataField(9) = "BirthDate"
oG2Host.Template = "DataField(10) = `HireDate`" // oG2Host.DataField(10) = "HireDate"
oG2Host.Template = "DataSource(`Links`) = rsLinks" // oG2Host.DataSource("Links") = rsLinks
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"

16
DAO sample ( file, single task, single table )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataTechnology(`Items`) = `DAO.DBEngine.120;DAO.DBEngine.36`" // oG2Host.DataTechnology("Items") = "DAO.DBEngine.120;DAO.DBEngine.36"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataField(7) = DataField(0)" // oG2Host.DataField(7) = oG2Host.DataField(0)
oG2Host.Template = "DataField(9) = `BirthDate`" // oG2Host.DataField(9) = "BirthDate"
oG2Host.Template = "DataField(10) = `HireDate`" // oG2Host.DataField(10) = "HireDate"
oG2Host.Template = "DataTechnology(`Links`) = `DAO.DBEngine.120;DAO.DBEngine.36`" // oG2Host.DataTechnology("Links") = "DAO.DBEngine.120;DAO.DBEngine.36"
oG2Host.Template = "DataSource(`Links`) = DataSource(`Items`)" // oG2Host.DataSource("Links") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Links`) = `EmployeeLinks`" // oG2Host.DataMember("Links") = "EmployeeLinks"
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"

15
DAO sample ( tree recordset )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataTechnology(`Items`) = `DAO.DBEngine.120;DAO.DBEngine.36`" // oG2Host.DataTechnology("Items") = "DAO.DBEngine.120;DAO.DBEngine.36"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"

14
DAO sample ( flat recordset )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim rsEmployees as P
Dim var_Database as P
Dim var_PrivDBEngine as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_PrivDBEngine = OLE.Create("DAO.DBEngine.120")
	var_Database = var_PrivDBEngine.OpenDatabase("C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
		rsEmployees = var_Database.OpenRecordset("Employees")
oG2Host.Template = "DataSource(`Items`) = rsEmployees" // oG2Host.DataSource("Items") = rsEmployees
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"

13
DAO sample ( flat )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataTechnology(`Items`) = `DAO.DBEngine.120;DAO.DBEngine.36`" // oG2Host.DataTechnology("Items") = "DAO.DBEngine.120;DAO.DBEngine.36"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"

12
ADO sample ( object, ADODB.Recordset, multiple tasks )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim rsEmployees as P
Dim rsLinks as P
Dim rsTasks as P
Dim var_Bar as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
rsEmployees = OLE.Create("ADODB.Recordset")
rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.Template = "DataSource(`Items`) = rsEmployees" // oG2Host.DataSource("Items") = rsEmployees
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
rsTasks = OLE.Create("ADODB.Recordset")
rsTasks.Open("EmployeeDetails","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.Template = "DataSource(`Tasks`) = rstasks" // oG2Host.DataSource("Tasks") = rstasks
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
rsLinks = OLE.Create("ADODB.Recordset")
rsLinks.Open("EmployeeLinks","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.Template = "DataSource(`Links`) = rsLinks" // oG2Host.DataSource("Links") = rsLinks
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
	var_Bar.OverlaidGroup = "Task,Progress"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

oG2Host.Host.Chart.ScrollTo({05/27/2017},1)

11
ADO sample ( file, multiple tasks, multiple tables )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_Bar as P
Dim var_Items as local

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataTechnology(`Items`) = `ADODB.Recordset;ADOR.Recordset`" // oG2Host.DataTechnology("Items") = "ADODB.Recordset;ADOR.Recordset"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataTechnology(`Tasks`) = `ADODB.Recordset;ADOR.Recordset`" // oG2Host.DataTechnology("Tasks") = "ADODB.Recordset;ADOR.Recordset"
oG2Host.Template = "DataSource(`Tasks`) = DataSource(`Items`)" // oG2Host.DataSource("Tasks") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Tasks`) = `EmployeeDetails`" // oG2Host.DataMember("Tasks") = "EmployeeDetails"
oG2Host.Template = "DataField(7) = `Tasks`" // oG2Host.DataField(7) = "Tasks"
oG2Host.Template = "DataField(8) = `EmployeeID`" // oG2Host.DataField(8) = "EmployeeID"
oG2Host.Template = "DataField(9) = `DateStart`" // oG2Host.DataField(9) = "DateStart"
oG2Host.Template = "DataField(10) = `DateEnd`" // oG2Host.DataField(10) = "DateEnd"
oG2Host.Template = "DataField(14) = `TaskID`" // oG2Host.DataField(14) = "TaskID"
oG2Host.Template = "DataTechnology(`Links`) = `ADODB.Recordset;ADOR.Recordset`" // oG2Host.DataTechnology("Links") = "ADODB.Recordset;ADOR.Recordset"
oG2Host.Template = "DataSource(`Links`) = DataSource(`Items`)" // oG2Host.DataSource("Links") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Links`) = `EmployeeLinks`" // oG2Host.DataMember("Links") = "EmployeeLinks"
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 'exOverlaidBarsStackAutoArrange + exOverlaidBarsStack
	var_Bar.OverlaidGroup = "Task,Progress"
' oG2Host.Host.Items.ExpandItem(0) = .t.
var_Items = oG2Host.Host.Items
oG2Host.TemplateDef = "dim var_Items"
oG2Host.TemplateDef = var_Items
oG2Host.Template = "var_Items.ExpandItem(0) = True"

oG2Host.Host.Chart.ScrollTo({05/27/2017},1)

10
ADO sample ( object, ADODB.Recordset, single task, single table )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim rsEmployees as P
Dim rsLinks as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
rsEmployees = OLE.Create("ADODB.Recordset")
rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.Template = "DataSource(`Items`) = rsEmployees" // oG2Host.DataSource("Items") = rsEmployees
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataField(7) = DataField(0)" // oG2Host.DataField(7) = oG2Host.DataField(0)
oG2Host.Template = "DataField(9) = `BirthDate`" // oG2Host.DataField(9) = "BirthDate"
oG2Host.Template = "DataField(10) = `HireDate`" // oG2Host.DataField(10) = "HireDate"
rsLinks = OLE.Create("ADODB.Recordset")
rsLinks.Open("EmployeeLinks","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.Template = "DataSource(`Links`) = rsLinks" // oG2Host.DataSource("Links") = rsLinks
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"

9
ADO sample ( file, single task, single table )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataTechnology(`Items`) = `ADODB.Recordset;ADOR.Recordset`" // oG2Host.DataTechnology("Items") = "ADODB.Recordset;ADOR.Recordset"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"
oG2Host.Template = "DataField(7) = DataField(0)" // oG2Host.DataField(7) = oG2Host.DataField(0)
oG2Host.Template = "DataField(9) = `BirthDate`" // oG2Host.DataField(9) = "BirthDate"
oG2Host.Template = "DataField(10) = `HireDate`" // oG2Host.DataField(10) = "HireDate"
oG2Host.Template = "DataTechnology(`Links`) = `ADODB.Recordset;ADOR.Recordset`" // oG2Host.DataTechnology("Links") = "ADODB.Recordset;ADOR.Recordset"
oG2Host.Template = "DataSource(`Links`) = DataSource(`Items`)" // oG2Host.DataSource("Links") = oG2Host.DataSource("Items")
oG2Host.Template = "DataMember(`Links`) = `EmployeeLinks`" // oG2Host.DataMember("Links") = "EmployeeLinks"
oG2Host.Template = "DataField(15) = `Links`" // oG2Host.DataField(15) = "Links"
oG2Host.Template = "DataField(16) = `Start`" // oG2Host.DataField(16) = "Start"
oG2Host.Template = "DataField(17) = `End`" // oG2Host.DataField(17) = "End"

8
ADO sample ( tree recordset )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataTechnology(`Items`) = `ADODB.Recordset;ADOR.Recordset`" // oG2Host.DataTechnology("Items") = "ADODB.Recordset;ADOR.Recordset"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
oG2Host.Template = "DataField(1) = `EmployeeID`" // oG2Host.DataField(1) = "EmployeeID"
oG2Host.Template = "DataField(2) = `ReportsTo`" // oG2Host.DataField(2) = "ReportsTo"

7
ADO sample ( flat recordset )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim rsEmployees as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
rsEmployees = OLE.Create("ADODB.Recordset")
rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.Template = "DataSource(`Items`) = rsEmployees" // oG2Host.DataSource("Items") = rsEmployees
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"

6
ADO sample ( flat table )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataTechnology(`Items`) = `ADODB.Recordset;ADOR.Recordset`" // oG2Host.DataTechnology("Items") = "ADODB.Recordset;ADOR.Recordset"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb"
oG2Host.Template = "DataMember(`Items`) = `Employees`" // oG2Host.DataMember("Items") = "Employees"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"

5
XML sample ( object, MSXML.DOMDocument )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_G2antt as P
Dim xml as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
xml = OLE.Create("MSXML.DOMDocument")
xml.async = .f.
xml.load("C:\Program Files\Exontrol\ExG2Host\Sample\sample.xml")
oG2Host.Template = "DataSource(`Items`) = xml" // oG2Host.DataSource("Items") = xml
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
var_G2antt = oG2Host.Host
	var_G2antt.LinesAtRoot = -1
	var_G2antt.SingleSel = .f.
	var_G2antt.AutoDrag = 3

4
XML sample ( file tree )

' Fired when an internal error occurs.
function Error as v (Error  as  N,Description  as  C)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? Error 
	? Description 
end function

Dim oG2Host as P
Dim var_G2antt as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.Template = "DataTechnology(`Items`) = `MSXML.DOMDocument`" // oG2Host.DataTechnology("Items") = "MSXML.DOMDocument"
oG2Host.Template = "DataSource(`Items`) = `C:\Program Files\Exontrol\ExG2Host\Sample\sample.xml`" // oG2Host.DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.xml"
oG2Host.Template = "DataField(0) = `Items`" // oG2Host.DataField(0) = "Items"
var_G2antt = oG2Host.Host
	var_G2antt.LinesAtRoot = -1
	var_G2antt.SingleSel = .f.
	var_G2antt.AutoDrag = 3

3
How can I let user create new items/bars when clicking the empty area of the control
' Notifies the application once the host fires an event.
function HostEvent as v (EventID  as  OLE::Exontrol.G2Host.1::HostEventEnum)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? oG2Host.HostEventParam(-2) 
end function

Dim oG2Host as P
Dim var_Chart as P
Dim var_G2antt as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
oG2Host.HostReadOnly = 255 'exHostReadWrite + exHostAllowAddEmptyItem
var_G2antt = oG2Host.Host
	var_G2antt.ScrollBars = 2058 'exVScrollEmptySpace + exDisableNoVertical
	var_Chart = var_G2antt.Chart
		' var_Chart.PaneWidth(.f.) = 128
		oG2Host.TemplateDef = "dim var_Chart"
		oG2Host.TemplateDef = var_Chart
		oG2Host.Template = "var_Chart.PaneWidth(False) = 128"

		var_Chart.AllowCreateBar = 1

2
How do I handle events of the host

' Notifies the application once the host fires an event.
function HostEvent as v (EventID  as  OLE::Exontrol.G2Host.1::HostEventEnum)
	oG2Host = topparent:CONTROL_ACTIVEX1.activex
	? oG2Host.HostEventParam(-2) 
end function

Dim oG2Host as P
Dim var_G2antt as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
var_G2antt = oG2Host.Host
	var_G2antt.BeginUpdate()
	var_G2antt.Columns.Add("new column")
	var_G2antt.EndUpdate()

1
How can I get the version of the host/exg2antt control

Dim oG2Host as P

oG2Host = topparent:CONTROL_ACTIVEX1.activex
? oG2Host.Version 
? "Host" 
? oG2Host.Host.Version