How to start?

The following screen shot, shows a general idea how parts and objects of the control are arranged: 

Parts of the Exontrol's eXG2antt Component

click to enlarge

The following steps shows you progressively how to start programming the Exontrol's ExG2antt component:

  • LoadXML / SaveXML methods, to load / save data using XML format.
  • DataSource property, to load / update / save data from a table, query, dataset and so on.
  • GetItems / PutItems methods, to load / save data from a/to safe array of data.
For instance, 
With G2antt1
	.LoadXML "http://www.exontrol.net/testing.xml"
End With
loads control's data from specified URL.
  • UnitScale property, determines the base time-unit scale to be displayed on the chart.
  • Label property, indicates the predefined format of the level's label for a specified unit, to be shown on the chart.
  • LevelCount property, specifies the number of levels to be shown on the chart's header.
For instance, 
With G2antt1
	With .Chart
		.LevelCount = 2
		.UnitScale = exDay
	End With
End With
specifies that the chart's header should display two levels, and the base time-unit scale to be day.
  • Add method, adds a new type of bar, including a combination of any of already predefined bars to display split or/and progress bars.
  • Copy property, clones an already predefined bar.
For instance, 
With G2antt1
	.Chart.Bars.Add("Task%Progress").Shortcut = "TProgress"
End With
defines a new task bar to display a progress bar inside. See Item-Bars, to see how you can add tasks/bars to the control's chart panel.
  • Add method, adds a new column.
  • ExpandColumns property specifies the columns to be shown/hidden when the column is expanded or collapsed.
For instance, 
With G2antt1
	With .Columns.Add("Check")
		.Position = 0
		.Def(exCellHasCheckBox) = True
	End With
End With
adds a new column that displays check-boxes, and that's the first visible column.
  • EditType method, specifies the built-in to be assigned to a cell or column.
  • Editor property, gets access to the column's built-in editor
  • CellEditorVisible property specifies the built-in editor for a particular cell.
For instance, 
With G2antt1
	With .Columns.Add("Date")
		.Editor.EditType = DateType
	End With
End With
adds a new column that displays and edits column's data as date type.
For instance, 
With G2antt1
	With .Items
		.AddItem "new item"
	End With
End With
adds a new item.
  • CellValue property, specifies the cell's value.
For instance, 
With G2antt1
	With .Items
		h = .InsertItem(.FocusItem,"","item 1.1")
		.CellValue(h,1) = "item 1.2"
		.CellValue(h,2) = "item 1.3"
		.ExpandItem(.FocusItem) = True
	End With
End With
adds a new child item of the focused item, and fills the cell's value for the second and third column.
  • AddBar method, adds a new bar of specified type, giving its time interval.
  • ItemBar property, updates properties of specified bar, like caption, effort, and so on
  • DefineSummaryBars method, defines child-bars of a summary bar.
For instance, 
With G2antt1
	With .Items
		.AddBar .FocusItem,"Task",#4/1/2006#,#4/14/2006#,"new"
	End With
End With
adds a new task to the focus item, with the key "new".
  • AddLink method, links two bars.
  • Link property, gets access to the link's properties
For instance, 
With G2antt1
	With .Items
		.AddBar .FocusItem,"Task",#4/1/2006#,#4/14/2006#,"A"
		.AddBar .FocusItem,"Task",#4/18/2006#,#4/30/2006#,"B"
		.AddLink "AB",.FocusItem,"A",.FocusItem,"B"
	End With
End With
adds two linked bars A and B in the same item.
  • Add method, associates a note to a date or task/bar.
For instance, 
With G2antt1
	With .Chart.Notes
		With .Add("D1",G2antt1.Items.FirstVisibleItem,G2antt1.Chart.FirstVisibleDate,"Date:<br><%dd%>/<%mm%><br><b><%yyyy%></b>")
			.PartCanMove(exNoteEnd) = True
			.PartVOffset(exNoteEnd) = 20
			.PartHOffset(exNoteEnd) = 20
		End With
	End With
End With
adds a note associated with first visible date.
Send comments on this topic.
1999-2016 Exontrol. All rights reserved.