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

// HostEvent event - Notifies the application once the host fires an event.
procedure TWinForm1.AxG2Host1_HostEvent(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_HostEventEvent);
begin
	with AxG2Host1 do
	begin
		h := get_HostEventParam(0);
		key := get_HostEventParam(1);
		OutputDebugString( get_HostEventParam(-2) );
		OutputDebugString( 'Start:' );
		OutputDebugString( Host.Items.ItemBar[h,TObject(key),1] );
		OutputDebugString( get_HostEventParam(-2) );
		OutputDebugString( 'End:' );
		OutputDebugString( Host.Items.ItemBar[h,TObject(key),2] );
	end
end;

with AxG2Host1 do
begin
	with (Host as EXG2ANTTLib.G2antt).Chart do
	begin
		PaneWidth[False] := 128;
		FirstVisibleDate := '3/30/2019';
	end;
	with (Host as EXG2ANTTLib.G2antt).Items do
	begin
		AddBar(AddItem('Task'),'Task','4/1/2019','4/14/2019',Nil,Nil);
	end;
end
49
How do I get the bar/task from the cursor
// HostEvent event - Notifies the application once the host fires an event.
procedure TWinForm1.AxG2Host1_HostEvent(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_HostEventEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( 'Event:' );
		OutputDebugString( get_HostEventParam(-2) );
		with (Host as EXG2ANTTLib.G2antt) do
		begin
			i := ItemFromPoint[-1,-1,c,h];
			OutputDebugString( 'Cell:' );
			OutputDebugString( Items.CellCaption[TObject(i),TObject(c)] );
			with Chart do
			begin
				b := BarFromPoint[-1,1];
				OutputDebugString( 'Bar:' );
				OutputDebugString( (AxG2Host1.Host as EXG2ANTTLib.G2antt).Items.ItemBar[i,TObject(b),0] );
			end;
		end;
	end
end;


48
How do I get the cell from the cursor

// HostEvent event - Notifies the application once the host fires an event.
procedure TWinForm1.AxG2Host1_HostEvent(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_HostEventEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( 'Event:' );
		OutputDebugString( get_HostEventParam(-2) );
		with (Host as EXG2ANTTLib.G2antt) do
		begin
			i := ItemFromPoint[-1,-1,c,h];
			OutputDebugString( 'Cell:' );
			OutputDebugString( Items.CellCaption[TObject(i),TObject(c)] );
		end;
	end
end;


47
How can I highlights cells based on its value

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,'Color');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,'TaskName');
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		BeginUpdate();
		BackColorAlternate := $0;
		with Columns.Item['Title'] do
		begin
			Def[4] := TObject(15790320);
			Width := AutoWidth;
		end;
		with ConditionalFormats do
		begin
			Add('lower(%4) contains `manager`',Nil).Bold := True;
			Add('%3',Nil).BackColor := $f0f0f0;
		end;
		Items.ExpandItem[0] := True;
		with Columns.Item['EmployeeID'] do
		begin
			Width := AutoWidth;
		end;
		EndUpdate();
	end;
end
46
How do I programatically hide a column

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,'Color');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,'TaskName');
	(Host as EXG2ANTTLib.G2antt).Columns.Item['LastName'].Visible := False;
end
45
Is it possible to get the information from the control when we click on the bar/item

// HostEvent event - Notifies the application once the host fires an event.
procedure TWinForm1.AxG2Host1_HostEvent(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_HostEventEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( get_HostEventParam(-2) );
		with (Host as EXG2ANTTLib.G2antt) do
		begin
			i := ItemFromPoint[-1,-1,c,hit];
			OutputDebugString( 'cell''s value from cursor: ' );
			OutputDebugString( Items.CellValue[TObject(i),TObject(c)] );
			OutputDebugString( 'cell''s value on col 1: ' );
			OutputDebugString( Items.CellValue[TObject(i),TObject(1)] );
			b := Chart.BarFromPoint[-1,-1];
			OutputDebugString( 'Bar:' );
			OutputDebugString( b );
			OutputDebugString( 'Bar Start:' );
			OutputDebugString( Items.ItemBar[i,TObject(b),1] );
			OutputDebugString( 'Bar End:' );
			OutputDebugString( Items.ItemBar[i,TObject(b),2] );
			OutputDebugString( 'Bar Caption:' );
			OutputDebugString( Items.ItemBar[i,TObject(b),3] );
		end;
	end
end;

with AxG2Host1 do
begin
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		Debug := True;
		with Chart.Bars.Item['Task'] do
		begin
			OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
			OverlaidGroup := 'Task,Progress';
		end;
	end;
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,'Color');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,'TaskName');
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	with (Host as EXG2ANTTLib.G2antt).Chart do
	begin
		PaneWidth[False] := 128;
		ScrollTo('5/27/2017',TObject(1));
	end;
end
44
How do I get the bar from the cursor

// HostEvent event - Notifies the application once the host fires an event.
procedure TWinForm1.AxG2Host1_HostEvent(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_HostEventEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( get_HostEventParam(-2) );
		OutputDebugString( Host.Chart.BarFromPoint[-1,-1] );
	end
end;

with AxG2Host1 do
begin
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		VisualAppearance.Add(1,'C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn');
		with Chart.Bars.Item['Task'] do
		begin
			Height := 15;
			Color := $1ff0000;
			OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
			OverlaidGroup := 'Task,Progress';
		end;
	end;
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,'Color');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,'TaskName');
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	with (Host as EXG2ANTTLib.G2antt).Chart do
	begin
		PaneWidth[False] := 128;
		ScrollTo('5/27/2017',TObject(1));
	end;
end
43
How do I add Start/End columns

// HostEvent event - Notifies the application once the host fires an event.
procedure TWinForm1.AxG2Host1_HostEvent(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_HostEventEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( get_HostEventParam(-2) );
	end
end;

with AxG2Host1 do
begin
	HostReadOnly := Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostReadWrite) Or Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostAllowAddEmptyItem);
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		SingleSel := False;
		OnResizeControl := 1;
		ScrollBars := Integer(EXG2ANTTLib.ScrollBarsEnum.exVScrollEmptySpace) Or Integer(EXG2ANTTLib.ScrollBarsEnum.exDisableNoVertical);
		with (Columns.Add('Start') as EXG2ANTTLib.Column) do
		begin
			AllowSizing := False;
			Def[18] := TObject(1);
			Editor.EditType := 7;
		end;
		with (Columns.Add('End') as EXG2ANTTLib.Column) do
		begin
			AllowSizing := False;
			Def[18] := TObject(2);
			Editor.EditType := 7;
		end;
		Items.AllowCellValueToItemBar := True;
		with Chart do
		begin
			AllowCreateBar := 1;
			PaneWidth[False] := 256;
			Bars.Item['Task'].OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
		end;
	end;
end
42
How do I hide the left/items/columns part of the control

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	with (Host as EXG2ANTTLib.G2antt).Chart.Bars.Item['Task'] do
	begin
		Pattern := 1;
		Color := $ff0000;
		Def[19] := TObject(50);
	end;
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,'Color');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,'TaskName');
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	HostReadOnly := Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostReadWrite) Or Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostAllowAddEmptyItem);
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		OnResizeControl := Integer(EXG2ANTTLib.OnResizeControlEnum.exDisableSplitter) Or Integer(EXG2ANTTLib.OnResizeControlEnum.exResizeChart);
		with Chart do
		begin
			ColumnsFormatLevel := '1';
			PaneWidth[False] := 0;
			ScrollTo('5/27/2017',TObject(1));
		end;
	end;
end
41
How do I hide the right/chart/tasks part of the control

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	with (Host as EXG2ANTTLib.G2antt).Chart.Bars.Item['Task'] do
	begin
		Pattern := 1;
		Color := $ff0000;
		Def[19] := TObject(50);
	end;
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,'Color');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,'TaskName');
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		with Chart do
		begin
			PaneWidth[True] := 0;
			OverviewVisible := 0;
		end;
	end;
end
40
How do hide the top/overview part of the control

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,get_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'BirthDate');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'HireDate');
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		with Chart do
		begin
			OverviewVisible := 0;
			PaneWidth[False] := 256;
			ScrollTo('4/27/1969',TObject(1));
		end;
	end;
end
39
How do I resize the panels

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		VisualAppearance.Add(1,'C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn');
		with Chart.Bars.Item['Task'] do
		begin
			Height := 15;
			Color := $1ff0000;
			OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
			OverlaidGroup := 'Task,Progress';
		end;
	end;
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,'Color');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,'TaskName');
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	with (Host as EXG2ANTTLib.G2antt).Chart do
	begin
		PaneWidth[False] := 128;
		ScrollTo('5/27/2017',TObject(1));
	end;
end
38
How do I lock the first column

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		CountLockedColumns := 1;
		BackColorLock := BackColorAlternate;
	end;
end
37
How do I specify a different color for the tasks ( EBN color )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		VisualAppearance.Add(1,'C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn');
		with Chart.Bars.Item['Task'] do
		begin
			Height := 15;
			Color := $1ff0000;
			OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
			OverlaidGroup := 'Task,Progress';
		end;
	end;
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,'Color');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,'TaskName');
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	(Host as EXG2ANTTLib.G2antt).Chart.PaneWidth[False] := 256;
	(Host as EXG2ANTTLib.G2antt).Chart.ScrollTo('5/27/2017',TObject(1));
end
36
How do I specify a different color for the tasks ( solid color, transparent )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	with (Host as EXG2ANTTLib.G2antt).Chart.Bars.Item['Task'] do
	begin
		Pattern := 1;
		Color := $ff0000;
		Def[19] := TObject(50);
	end;
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,'Color');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,'TaskName');
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	(Host as EXG2ANTTLib.G2antt).Chart.PaneWidth[False] := 256;
	(Host as EXG2ANTTLib.G2antt).Chart.ScrollTo('5/27/2017',TObject(1));
end
35
GroupBy

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataSource('Links',get_DataSource('Items'));
	set_DataMember('Links','EmployeeLinks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		AllowGroupBy := True;
		SortBarVisible := True;
		BackColorSortBar := (AxG2Host1.Host as EXG2ANTTLib.G2antt)BackColor;
		BackColorSortBarCaption := BackColorSortBar;
		SortBarCaption := '<sha ;;0><fgcolor=FF0000>Drag a <b>column</b> header here to sort by that column.';
		with Chart.Bars.Item['Task'] do
		begin
			OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
			OverlaidGroup := 'Task,Progress';
		end;
		Items.ExpandItem[0] := True;
		CountLockedColumns := 1;
		BackColorLock := BackColorAlternate;
		with Columns.Item['EmployeeID'] do
		begin
			AllowGroupBy := False;
			Def[7] := TObject((AxG2Host1.Host as EXG2ANTTLib.G2antt).BackColorAlternate);
		end;
		Columns.Item['Title'].SortOrder := 1;
	end;
	(Host as EXG2ANTTLib.G2antt).Chart.ScrollTo('5/27/2017',TObject(1));
end
34
How can I hide a column
// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	(Host as EXG2ANTTLib.G2antt).Columns.Item[TObject(0)].Visible := False;
end
33
Can row errors being highligted until the user correct them, not to clear them as soon a change occurs

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_HostDef(EXG2HOSTLib.DefHostPropertyEnum.exErrorClearOnChange,TObject(False));
end
32
No error is highligthed

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
end
31
I've noticed that rows with errors are shown in red. Is it possible to change the colors

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_HostDef(EXG2HOSTLib.DefHostPropertyEnum.exErrorBackColor,TObject(0));
	set_HostDef(EXG2HOSTLib.DefHostPropertyEnum.exErrorForeColor,TObject(16777215));
end
30
Is it possible to rename the (New) to something else

with AxG2Host1 do
begin
	set_HostDef(EXG2HOSTLib.DefHostPropertyEnum.exNew,'*');
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		BeginUpdate();
		Items.AddItem('A');
		Items.AddItem('B');
		EndUpdate();
	end;
	Refresh();
end
29
How can I hide the (New) item (sample 2)

with AxG2Host1 do
begin
	HostReadOnly := Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostAllowUpdate) Or Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostAllowDelete);
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		BeginUpdate();
		Items.AddItem('A');
		Items.AddItem('B');
		EndUpdate();
	end;
end
28
How can I hide the (New) item (sample 1)

with AxG2Host1 do
begin
	set_HostDef(EXG2HOSTLib.DefHostPropertyEnum.exNew,'');
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		BeginUpdate();
		Items.AddItem('A');
		Items.AddItem('B');
		EndUpdate();
	end;
	Refresh();
end
27
Read-Only

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	HostReadOnly := EXG2HOSTLib.HostReadOnlyEnum.exHostReadOnly;
end
26
How can I prevent user create new /delete tasks ( only move or resize then )
// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataSource('Links',get_DataSource('Items'));
	set_DataMember('Links','EmployeeLinks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
	with (Host as EXG2ANTTLib.G2antt).Chart.Bars.Item['Task'] do
	begin
		OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
		OverlaidGroup := 'Task,Progress';
	end;
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	HostReadOnly := EXG2HOSTLib.HostReadOnlyEnum.exHostAllowUpdate;
	(Host as EXG2ANTTLib.G2antt).Chart.ScrollTo('5/27/2017',TObject(1));
end
25
How do I get the row/item/task/link from the cursor

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

// HostEvent event - Notifies the application once the host fires an event.
procedure TWinForm1.AxG2Host1_HostEvent(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_HostEventEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( HostContext.ToString );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	HostReadOnly := Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostAllowUpdate) Or Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostAllowAddNew);
end
24
Disable Delete
// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	HostReadOnly := Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostAllowUpdate) Or Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostAllowAddNew);
end
23
Disable AddNew

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	HostReadOnly := Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostAllowUpdate) Or Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostAllowDelete);
end
22
ACCDB sample ( file )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataSource('Links',get_DataSource('Items'));
	set_DataMember('Links','EmployeeLinks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
	with (Host as EXG2ANTTLib.G2antt).Chart.Bars.Item['Task'] do
	begin
		OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
		OverlaidGroup := 'Task,Progress';
	end;
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	(Host as EXG2ANTTLib.G2antt).Chart.ScrollTo('5/27/2017',TObject(1));
end
21
MDB sample ( file )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.mdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataSource('Links',get_DataSource('Items'));
	set_DataMember('Links','EmployeeLinks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
	with (Host as EXG2ANTTLib.G2antt).Chart.Bars.Item['Task'] do
	begin
		OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
		OverlaidGroup := 'Task,Progress';
	end;
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	(Host as EXG2ANTTLib.G2antt).Chart.ScrollTo('5/27/2017',TObject(1));
end
20
DBF sample ( file )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.dbf');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
end
19
DAO sample ( object, DAO.DBEngine.120, multiple tasks, multiple tables )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	with (ComObj.CreateComObject(ComObj.ProgIDToClassID('DAO.DBEngine.120')) as DAO.PrivDBEngine) do
	begin
		with OpenDatabase('C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb',Nil,Nil,Nil) do
		begin
			rsEmployees := (OpenRecordset('Employees',Nil,Nil,Nil) as DAO.Recordset2);
			rsTasks := (OpenRecordset('EmployeeDetails',Nil,Nil,Nil) as DAO.Recordset2);
			rsLinks := (OpenRecordset('EmployeeLinks',Nil,Nil,Nil) as DAO.Recordset2);
		end;
	end;
	set_DataSource('Items',(rsEmployees as DAO.Recordset2));
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataSource('Tasks',(rsTasks as DAO.Recordset2));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataSource('Links',(rsLinks as DAO.Recordset2));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
	with (Host as EXG2ANTTLib.G2antt).Chart.Bars.Item['Task'] do
	begin
		OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
		OverlaidGroup := 'Task,Progress';
	end;
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	(Host as EXG2ANTTLib.G2antt).Chart.ScrollTo('5/27/2017',TObject(1));
end
18
DAO sample ( file, multiple tasks, multiple tables )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataTechnology('Items','DAO.DBEngine.120;DAO.DBEngine.36');
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataTechnology('Tasks','DAO.DBEngine.120;DAO.DBEngine.36');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataTechnology('Links','DAO.DBEngine.120;DAO.DBEngine.36');
	set_DataSource('Links',get_DataSource('Items'));
	set_DataMember('Links','EmployeeLinks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
	with (Host as EXG2ANTTLib.G2antt).Chart.Bars.Item['Task'] do
	begin
		OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
		OverlaidGroup := 'Task,Progress';
	end;
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	(Host as EXG2ANTTLib.G2antt).Chart.ScrollTo('5/27/2017',TObject(1));
end
17
DAO sample ( object, DAO.DBEngine.120, single task, single table )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	with (ComObj.CreateComObject(ComObj.ProgIDToClassID('DAO.DBEngine.120')) as DAO.PrivDBEngine) do
	begin
		with OpenDatabase('C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb',Nil,Nil,Nil) do
		begin
			rsEmployees := (OpenRecordset('Employees',Nil,Nil,Nil) as DAO.Recordset2);
			rsLinks := (OpenRecordset('EmployeeLinks',Nil,Nil,Nil) as DAO.Recordset2);
		end;
	end;
	set_DataSource('Items',(rsEmployees as DAO.Recordset2));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,get_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'BirthDate');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'HireDate');
	set_DataSource('Links',(rsLinks as DAO.Recordset2));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
end
16
DAO sample ( file, single task, single table )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataTechnology('Items','DAO.DBEngine.120;DAO.DBEngine.36');
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,get_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'BirthDate');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'HireDate');
	set_DataTechnology('Links','DAO.DBEngine.120;DAO.DBEngine.36');
	set_DataSource('Links',get_DataSource('Items'));
	set_DataMember('Links','EmployeeLinks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
end
15
DAO sample ( tree recordset )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataTechnology('Items','DAO.DBEngine.120;DAO.DBEngine.36');
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
end
14
DAO sample ( flat recordset )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	with (ComObj.CreateComObject(ComObj.ProgIDToClassID('DAO.DBEngine.120')) as DAO.PrivDBEngine) do
	begin
		with OpenDatabase('C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb',Nil,Nil,Nil) do
		begin
			rsEmployees := (OpenRecordset('Employees',Nil,Nil,Nil) as DAO.Recordset2);
		end;
	end;
	set_DataSource('Items',(rsEmployees as DAO.Recordset2));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
end
13
DAO sample ( flat )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataTechnology('Items','DAO.DBEngine.120;DAO.DBEngine.36');
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
end
12
ADO sample ( object, ADODB.Recordset, multiple tasks )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	rsEmployees := (ComObj.CreateComObject(ComObj.ProgIDToClassID('ADODB.Recordset')) as ADODB.Recordset);
	rsEmployees.Open('Employees','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb',3,3,Nil);
	set_DataSource('Items',(rsEmployees as ADODB.Recordset));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	rsTasks := (ComObj.CreateComObject(ComObj.ProgIDToClassID('ADODB.Recordset')) as ADODB.Recordset);
	rsTasks.Open('EmployeeDetails','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb',3,3,Nil);
	set_DataSource('Tasks',(rstasks as ADODB.Recordset));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	rsLinks := (ComObj.CreateComObject(ComObj.ProgIDToClassID('ADODB.Recordset')) as ADODB.Recordset);
	rsLinks.Open('EmployeeLinks','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb',3,3,Nil);
	set_DataSource('Links',(rsLinks as ADODB.Recordset));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
	with (Host as EXG2ANTTLib.G2antt).Chart.Bars.Item['Task'] do
	begin
		OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
		OverlaidGroup := 'Task,Progress';
	end;
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	(Host as EXG2ANTTLib.G2antt).Chart.ScrollTo('5/27/2017',TObject(1));
end
11
ADO sample ( file, multiple tasks, multiple tables )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataTechnology('Items','ADODB.Recordset;ADOR.Recordset');
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataTechnology('Tasks','ADODB.Recordset;ADOR.Recordset');
	set_DataSource('Tasks',get_DataSource('Items'));
	set_DataMember('Tasks','EmployeeDetails');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,'Tasks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'DateStart');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'DateEnd');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,'TaskID');
	set_DataTechnology('Links','ADODB.Recordset;ADOR.Recordset');
	set_DataSource('Links',get_DataSource('Items'));
	set_DataMember('Links','EmployeeLinks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
	with (Host as EXG2ANTTLib.G2antt).Chart.Bars.Item['Task'] do
	begin
		OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack);
		OverlaidGroup := 'Task,Progress';
	end;
	(Host as EXG2ANTTLib.G2antt).Items.ExpandItem[0] := True;
	(Host as EXG2ANTTLib.G2antt).Chart.ScrollTo('5/27/2017',TObject(1));
end
10
ADO sample ( object, ADODB.Recordset, single task, single table )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	rsEmployees := (ComObj.CreateComObject(ComObj.ProgIDToClassID('ADODB.Recordset')) as ADODB.Recordset);
	rsEmployees.Open('Employees','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb',3,3,Nil);
	set_DataSource('Items',(rsEmployees as ADODB.Recordset));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,get_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'BirthDate');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'HireDate');
	rsLinks := (ComObj.CreateComObject(ComObj.ProgIDToClassID('ADODB.Recordset')) as ADODB.Recordset);
	rsLinks.Open('EmployeeLinks','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb',3,3,Nil);
	set_DataSource('Links',(rsLinks as ADODB.Recordset));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
end
9
ADO sample ( file, single task, single table )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataTechnology('Items','ADODB.Recordset;ADOR.Recordset');
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,get_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,'BirthDate');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,'HireDate');
	set_DataTechnology('Links','ADODB.Recordset;ADOR.Recordset');
	set_DataSource('Links',get_DataSource('Items'));
	set_DataMember('Links','EmployeeLinks');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,'Links');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,'Start');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,'End');
end
8
ADO sample ( tree recordset )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataTechnology('Items','ADODB.Recordset;ADOR.Recordset');
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,'EmployeeID');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,'ReportsTo');
end
7
ADO sample ( flat recordset )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	rsEmployees := (ComObj.CreateComObject(ComObj.ProgIDToClassID('ADODB.Recordset')) as ADODB.Recordset);
	rsEmployees.Open('Employees','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb',3,3,Nil);
	set_DataSource('Items',(rsEmployees as ADODB.Recordset));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
end
6
ADO sample ( flat table )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataTechnology('Items','ADODB.Recordset;ADOR.Recordset');
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb');
	set_DataMember('Items','Employees');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
end
5
XML sample ( object, MSXML.DOMDocument )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	xml := (ComObj.CreateComObject(ComObj.ProgIDToClassID('MSXML.DOMDocument')) as MSXML2.FreeThreadedDOMDocument30);
	xml.async := False;
	xml.load('C:\Program Files\Exontrol\ExG2Host\Sample\sample.xml');
	set_DataSource('Items',(xml as MSXML2.FreeThreadedDOMDocument30));
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		LinesAtRoot := -1;
		SingleSel := False;
		AutoDrag := 3;
	end;
end
4
XML sample ( file tree )

// Error event - Fired when an internal error occurs.
procedure TWinForm1.AxG2Host1_Error(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_ErrorEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( e.error );
		OutputDebugString( e.description );
	end
end;

with AxG2Host1 do
begin
	set_DataTechnology('Items','MSXML.DOMDocument');
	set_DataSource('Items','C:\Program Files\Exontrol\ExG2Host\Sample\sample.xml');
	set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,'Items');
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		LinesAtRoot := -1;
		SingleSel := False;
		AutoDrag := 3;
	end;
end
3
How can I let user create new items/bars when clicking the empty area of the control
// HostEvent event - Notifies the application once the host fires an event.
procedure TWinForm1.AxG2Host1_HostEvent(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_HostEventEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( get_HostEventParam(-2) );
	end
end;

with AxG2Host1 do
begin
	HostReadOnly := Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostReadWrite) Or Integer(EXG2HOSTLib.HostReadOnlyEnum.exHostAllowAddEmptyItem);
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		ScrollBars := Integer(EXG2ANTTLib.ScrollBarsEnum.exVScrollEmptySpace) Or Integer(EXG2ANTTLib.ScrollBarsEnum.exDisableNoVertical);
		with Chart do
		begin
			PaneWidth[False] := 128;
			AllowCreateBar := 1;
		end;
	end;
end
2
How do I handle events of the host

// HostEvent event - Notifies the application once the host fires an event.
procedure TWinForm1.AxG2Host1_HostEvent(sender: System.Object; e: AxEXG2HOSTLib._IG2HostEvents_HostEventEvent);
begin
	with AxG2Host1 do
	begin
		OutputDebugString( get_HostEventParam(-2) );
	end
end;

with AxG2Host1 do
begin
	with (Host as EXG2ANTTLib.G2antt) do
	begin
		BeginUpdate();
		Columns.Add('new column');
		EndUpdate();
	end;
end
1
How can I get the version of the host/exg2antt control

with AxG2Host1 do
begin
	OutputDebugString( Version );
	OutputDebugString( 'Host' );
	OutputDebugString( Host.Version );
end