The following screen shot, shows a general idea how parts and objects of the control are arranged:
click to enlarge
The following steps shows you progressively how to start programming the Exontrol's ExG2antt component:
For instance,
- 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.
loads control's data from specified URL.With G2antt1 .LoadXML "https://www.exontrol.net/testing.xml" End With
For instance,
- 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.
specifies that the chart's header should display two levels, and the base time-unit scale to be day.With G2antt1 With .Chart .LevelCount = 2 .UnitScale = exDay End With End With
For instance,
- 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.
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.With G2antt1 .Chart.Bars.Add("Task%Progress").Shortcut = "TProgress" End With
For instance,
- Add method, adds a new column.
- ExpandColumns property specifies the columns to be shown/hidden when the column is expanded or collapsed.
adds a new column that displays check-boxes, and that's the first visible column.With G2antt1 With .Columns.Add("Check") .Position = 0 .Def(exCellHasCheckBox) = True End With End With
For instance,
- 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.
adds a new column that displays and edits column's data as date type.With G2antt1 With .Columns.Add("Date") .Editor.EditType = DateType End With End With
For instance,
- AddItem method, adds a new item.
- InsertItem method, inserts a child item
- InsertControlItem method, inserts a child item that hosts another control inside.
adds a new item.With G2antt1 With .Items .AddItem "new item" End With End With
For instance,
- CellValue property, specifies the cell's value.
adds a new child item of the focused item, and fills the cell's value for the second and third column.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
For instance,
- 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.
adds a new task to the focus item, with the key "new".With G2antt1 With .Items .AddBar .FocusItem,"Task",#4/1/2006#,#4/14/2006#,"new" End With End With
For instance,adds two linked bars A and B in the same item.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
For instance,
- Add method, associates a note to a date or task/bar.
adds a note associated with first visible date.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