News in version
TreeGrid Gantt chart SpreadSheet Examples Documentation Download Development Licensing Prices References Contacts Buy Try it free
Documentation
Search in documentation
TreeGrid versions compatibility

Changes log (txt file) Using custom CSS from 13.3 to 14.0 Upgrading from 9.3 to 10.0 Upgrading from 5.9 to 6.0

Using in JavaScript frameworks

Angular Ember Express React Svelte Vue Other frameworks NodeJS server SalesForce LWC

Creating grid

Simple examples Basic information Creating grid Deleting grid Reloading grid Rendering grid Accessing grid by API

Data & communication
Data communication with server

Communication types AJAX communication AJAX SOAP envelope Submit communication Directly included data Data from JavaScript Cross domain / local load by JSONP Sessions (AJAX) Server response (AJAX) Synchronous communication (AJAX) Caching (AJAX) API (AJAX)

Download data

Settings for data download Layout XML structure Data XML structure

Upload data

Settings for data upload API for upload XML structure sent to server

Changing data from server

XML structure of download changes XML structure of request for a cell Synchronizing data with server

Input / output data formats

Complete list of tags Internal XML format Short XML format Extra short XML format DTD XML format JSON format

Cells
Cell basics

Cell type Cell format Dynamic format Dynamic type Cell value Reading / writing attributes by API Cell HTML Cell default Range or more values in one cell Cell with link URL Cell hint Cell tooltip / title Cell popup menu

Cell editing and changing values

Cell editability Dynamic editing Locking Defaults list Suggest list (auto complete) Tags input Changing cell value Mass cell change Clearing cells Editing cells Controlling <input> tag by JavaScript Input validation and restrictions Side checkbox Cell selecting

Calculations - cell formulas

Basics Formulas Mathematical functions Aggregate functions Special functions for actions Custom functions

Calculations - editable cell formulas

Basics Suggest list (auto complete) Defined names Actions for choosing cells Conditional functions Lookup functions Cell reference functions Logical functions Informational functions Mathematical functions Trigonometry functions Rounding numbers Number conversions String functions Date functions Summary functions Custom functions

Cell side buttons

Introduction Right side Button Left side Icon

Cell spanning

Column span Row span Dynamic spanning

Cell style and color

Basic grid style Sizing and scaling - responsive design Dynamic cell style attributes Cell CSS class Cell background color Dynamic cell border Cell HTML style Row color alteration Cell mouse cursor

Editable cell images

Insert image Edit image

Cell types
Automatic type - Auto String - Text, Lines & Pass
Number - Int & Float

Format Localization

Date and time - Date

Format Calendar component Dates dialog Localization

List & combo - Enum & Radio

Introduction Definition Related lists Enum specific Radio specific

Checkbox - Bool
Action button - Button

Introduction Basic clickable button Switch button Radio / tab button Menu button Combo switch button Combo radio / tab button Special Space rows with buttons

Panel with more buttons - Panel

Definition Standard fast panel Custom panel

HTML and special types

Html type EHtml type (editable) Icon type Abs type List type Editable Link type Editable Img type DropCols type Upload File type

Columns

Column basics Column index Column visibility Column visibility menu Column selecting Column tree Auto column tree Column position and moving Column adding and copying Column deleting Column width Column API

Rows
Row basics

Rows by functionality Rows by position Row name Row id Row index

Default rows

Description Example of default rows Example of changing default row Attributes

Row tree

Tree attributes Actions & API for expand / collapse

Row identification

Setting row id attribute Row id attribute in tree Row id created from cell values API for row ids

Row visibility
Row adding and copying

Five ways of adding rows to grid Adding and copying restrictions Adding new empty rows Copying existing rows

Row deleting Row moving and dragging Row selecting Row height Row API Space rows
Features
Sorting rows

Sort settings Controlling sort position Comparing strings Sorting actions Sorting API

Grouping rows to tree

Group settings Creating groups Comparing strings Created group rows <D Group='1'/> User interface to choose grouping Grouping actions and API

Filtering rows

Filter settings Comparing strings User interface to choose filter Filter actions and API

Searching in rows and cells

Search settings User interface for search Search actions and API

Printing grid

Print settings Choosing items to print Page size Print API

Print / export to PDF

Introduction Client side settings Printing options Client side API Server side API Data sent from client to server

Export to Excel or CSV

Introduction and export types Basic settings Styling export XLSX export Gantt export CSV export Old XLS / XHTML export Export API Communication with server Client export Server export

Import from Excel

Basic settings Sheets manipulation

Copy & paste rows via clipboard

Copy & paste permissions Copying to clipboard Pasting from clipboard

Master - detail grids

Introduction External master - detail grids Nested master - detail grids Synchronizing grids Other attributes for master - detail

Pivot tables

Pivot attributes & API Pivot formulas

External objects (custom JavaScript objects) Undo & Redo
Gantt and bar chart
Gantt objects

Gantt objects list Display settings Edit settings

Main bar

Definition of main bar and plans Main bar as Task Edit settings Main bar content and side html Tip on mouse hover Vertical position and height Style specific attributes API to manipulate Main bars Actions Side text (deprecated) Real Flow (deprecated)

Run bar

GanttRun Definition Extended definition Run bar as Task Edit settings Save format Selecting Run boxes Run box content and side html Tip on mouse hover Box identification Vertical position and height Style specific attributes Overlaid (Error) boxes Containers for more boxes Dragging - moving and resizing API to manipulate Run boxes Actions Run special formulas

Summary task

Main for Main Main for Run Editable Main Editable Run

Gantt icons - Flag & Point

Flag - icon with text Point - math points

Gantt display objects

Header - column captions Cell and column Background Vertical movable Line Mark & Progress line

Gantt zoom

Zoom options Chart size limits Zoom selection Paging in Gantt chart

Dependency, constraints & schedule

Introduction Data units Defining dependencies Dependency colors and shapes Changing dependencies Correcting dependencies Scheduling algorithm Project date constraints Task date constraints Critical path - Slack (Float)

Gantt calendars

Global base calendar Local calendar Calendar list Calendars dialog Other settings

Gantt resources

Resources list Resources assign Resources filter Resources calculations Availability chart Resource usage chart Generated resource usage chart

Gantt popup menu Gantt API
Line and XY points charts

Charts in grid cells Chart JSON definition Base chart settings Basic attributes Size Axis and caption Individual chart lines Data sources Visual settings API for standalone usage

Paging in large grids
Paging root rows

Paging types and attributes Auto adding root pages API for paging

Pager components

Side pager Side pager type Pages Side pager type Gantt Side pager type Custom Pager with navigation buttons & edit Pager as list of page indexes

Paging in tree

ChildPaging - load / render on expand MaxChildren - limit children count ChildParts - load / render on scroll

Paging columns

Paging types and attributes Auto adding column pages API for column paging

Server paging

Server paging for root rows Server communication in root paging Root paging in very large tables Server paging in tree Server communication in tree paging XML Request for Data in root paging XML Download Data in root paging XML Request for root Page / children XML Download root Page / children API for server paging

TreeGrid DLL/SO for server paging

Introduction Compatibility with TreeGrid control Using TreeGrid server DLL/SO ASP.NET C# ASP.NET VB PHP JSP Java TreeGrid server concepts Function reference Calculations

JSON menus and dialogs
JSON menu description JSON menu definition example
Menu settings

Base attributes Visual settings Key navigation Behavior Size and scroll

Menu item settings

Base attributes Clickable item Inactive caption Collapsible sub level Popup sub menu Columns Bool item Enum item Edit item

Custom menu in JavaScript

Show custom menu Custom menu position Custom menu advanced settings Custom menu JavaScript events Custom menu JavaScript methods

Calendar dialog Custom calendar & JavaScript events Custom dialog in JavaScript
Global grid settings
Grid size and scroll

Default behavior Maximize grid height and width Update size according to the content Let a user to control the grid size Widths of individual sections Other scrolling attributes and API

Media rules - responsive design
Languages

Language & regional setup (Text.xml) Translate texts dynamically Change language

Grid cursor - Focus & hover

Focused cell and row Focused cell range Move and copy focused cells Filling cell values by dragging Tabulator navigation Key navigation Cursor look - focus & hover

Selecting rows, cells and columns

Selecting base Selecting rows Selecting cells Selecting columns

Global settings

Status messages Configuration menus Configuration menu - options Configuration menu - columns Configuration menu - print / PDF Configuration menu - export Default toolbar Useful API function Help file

Animations

Animations base Row animations Column animations Cell animations Animations for undo / redo Animations for server side changes Dialog animations

Grid configuration in cookies
Mouse & key events & actions

List of event handler types TreeGrid mouse events Mouse event names Key and mouse button prefixes Touch event names Event targets Assigning event actions / callbacks Event action parameters Action name suffix Calling actions from JavaScript Creating custom actions Focused vs. Actual cell TreeGrid key events JavaScript API events

Mouse API event TreeGrid files
Debugging and testing

Debug window Automated testing

Gantt calendars - excluded dates / holidays

TreeGrid documentation

The calendar specifies the dates that are not used in Gantt calculation, they are named "excluded dates". These dates behave like they don't exist at all.
There are two calendars, global (GanttExclude) and local per row (GanttCalendar).
You can exclude from dependency calculations and task duration any dates or date range like weekends, working hours or any exact custom dates.
The excluded dates can be shown in chart with different background or can be completely hidden (only global calendar).

Global calendar

Ignores or hides non workdays, non working hours or any other dates in the whole chart

new 6.3 upd 10.0 <C> string

GanttExclude

Can be uploaded to server
Global calendar. It is used for all rows that don't have set custom calendar by GanttCalendar.
Date ranges hidden from Gantt chart. The ranges are separated by semicolon, the values by tilde and the repeater by '#'.
The format is: repeater1#date1a~date1b#type1;repeater2#date2a~date2b#type2;...
The repeater can be one of GanttDataUnits. If it is missing, the date is not repeated. The date is repeated also before it.
(Since 7.0) The type value is by default empty to standard exclude.
If the type value is set to 0, the defined dates are included instead of excluded, to return some dates to previously excluded ranges.
The items are processed one by one, so if some date is more times excluded and included, the last result is used.
Other type values represent given GanttBackground classes defined by GxGanttBackXXX, where Gx is the style prefix like "GW" for White and XXX is the type value.
(Since 10.0) There are 11 predefined gray classes from 0 (white) to 10 (black)
(Since 10.0) There are 17 predefined color classes, case sensitive - Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Orange, Purple, Red, Silver, Teal, White, Yellow
For example: GanttExclude = 'w#1/5/2008~1/7/2008; d#00:00~9:00; d#13:00~14:00; d#18:00~24:00' shows only hours 8:00 - 13:00 and 14:00 - 18:00 and only workdays.
(Since 7.0) It is possible to limit the repeating, when the date range is wider than the repeater, the range is rounded to the repeater range and repeated only between the dates.
For example 'w#1/5/2008~12/29/2008' excludes all weekends, but only in year 2008.
(Since 7.0) It is possible to set the second date before the first one, it will be updated to correctly fill the repeat range.
For example #18:00~8:00' excludes all times from 18:00 to 8:00.
(Since 8.0) It can be also Calendar name, defined in Calendars array.
Remember, excluding too small units (e.g. minutes when chart shows years) can remarkably slow down the Gantt and Exclude calculation. For example GanttExclude='12:00~13:00' will exclude hours, but for '11:55~12:55' will exclude 5 minutes.
Due internal implementation the chart start date should be rounded to exclude units, check especially GanttChartMaxStart / GanttChartMinStart.
deleted 7.0 <C> string

GanttInclude

Can be uploaded to server
Replaced by GanttExclude with the third parameter type = 0
new 6.3 upd 9.1 <C> int

GanttHideExclude

[0] Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
Type of displaying excluded dates:
0 - displayed - all the dates are displayed, the Exclude is used only to specify correct / incorrect dependencies and when moving bars.
1 - hidden - all ranges from exclude are hidden from chart (the custom calendars in rows can be displayed incorrectly)
2 - displayed like 0, but without background (new 9.0)
3 - hidden like 1, but without background (new 9.0)
4 - displayed like 0, but without background for ranges smaller than GanttUnits (new 9.1)
5 - hidden like 1, but without background for ranges smaller than GanttUnits (new 9.1)

It is possible to set different zoom settings for case the Exclude is hidden by items with suffix Ex, like ... GanttWidth:18,GanttWidthEx:22 ...
It affects only global calendar defined by GanttExclude, not the custom calendars defined by GanttCalendar.
new 6.3 API method void

SetHideExclude

(bool hide)
Changes GanttHideExclude and refreshes Gantt and zoom.
If hide is null changes the value 0/1
new 6.3 chg 8.0 <C> int

GanttMaxExclude

[10000000]
Maximal count of units in chart to compute exclude.
The count is computed as (maxdate-mindate) * excludeunits.
The maxdate and mindate depend on the chart content and also on chart round and minimal column width to display.
The excludeunits is the smallest unit used in dates in GanttExclude / GanttCalendar. For example GanttExclude='12:00~13:00' will be hours, but for '11:55~12:55' will be 5 minutes.
Since 8.0 the default value has been increased to 10 million. And excludes containing more units are ignored and can lead to errors in calculations.
The default 10 million is about 3.8 months for excluded seconds, 19 years for excluded minutes and 1100 years for excluded hours, so it should be enough for all normal excludes.

Local calendar

Ignores non workdays, non working hours or any other dates in particular row

new 8.0 <C> string

GanttCalendar

If set to something, grid supports more calendars (excludes) per grid (one calendar per row). It will slightly slow down the grid.
Can be set to:a) column name to be the calendar name or exclude string read from
b) calendar name to be the exclude string read from
c) direct exclude string
d) "1" just to support the custom calendars and read the calendar value from attributes GanttCalendar in individual cells, see below
Remember, defining many different calendars can remarkably slow down the chart.
The exclude string is described at GanttExclude.
Don't set it, if you want to have only one calendar in grid, set GanttExclude instead, it will be faster.
new 8.0 <cell> string

GanttCalendar

Custom calendar for given row. Used only when set column GanttCalendar, see above.
Can be set to:a) column name to be the calendar name or exclude string read from
b) calendar name to be the exclude string read from
c) direct exclude string
These excluded dates are not affected by GanttHideExclude.
If the calendar for the row is set empty, it used global calendar from GanttExclude.
The exclude string is described at GanttExclude.

Calendar list

Defining individual calendars to assign

new 8.0 <Calendars>

<E>

One calendar definition. It can be placed only in root <Calendars> tag.
For example simple definition can be:
<Grid>
...
<Calendars>
<E Name='Workdays' Exclude='w#1/5/2008~1/7/2008'/>
<E Name='Workhours' Exclude='d#18:00~9:00; d#13:00~14:00#1; w#1/5/2008~1/7/2008#2;'/>
<E Name='All' Exclude=''/>
</Calendars>
<Grid>
new 8.0 <E> string

Name

Unique name of the calendar.
This name can be assigned into GanttExclude and GanttCalendar attributes.
new 8.0 <E> string

Exclude

Dates excluded in this calendar.
Format is the same as in GanttExclude.
new 6.4 API variable object[ ]

Calendars

The array of all calendars in grid, accessible by its name.
The calendar objects contain all the XML attributes like Exclude or Name.
Example: Grid.Calendars.Standard.Exclude = 'w#1/5/2008~1/7/2008';
Use ChangeExclude method for modifications instead of direct changes.

Calendars dialog

Showing dialog to choose calendar

new 8.0 API method void

ShowGanttCalendars

(TRow row, string col, bool sort = 0)
Sets Defaults attribute of the cell to the list of calendars.
Call it from XML event OnClickSideDefaults to show actual list of calendars. OnClickSideDefaults = "Grid.ShowGanttCalendars(Row,Col)"
If set sort = 1, it sorts the items according to the alphabet, for 0 it shows them in defined order.
It adds also two predefined options, "None" or "Default" and "Edit".
The "None" is displayed in space row for global calendar and sets the calendar empty. Hide it by <Lang><Text CalendarNone=""/></Lang>.
The "Default" is displayed in data row for custom calendar and sets the custom calendar to global calendar. Hide it by <Lang><Text CalendarDefault=""/></Lang>.
The "Edit" is displayed in both locations and shows modal dialog to edit, add and delete all the calendars defined in grid. Hide it by <Lang><Text CalendarEdit=""/></Lang>.
new 8.0 API method void

EditGanttCalendars

( )
Shows modal dialog to edit, add or delete individual calendars defined in grid.
This dialog is shown also in "Edit..." option in ShowGanttCalendars.
new 8.0 <Cfg> type

CalendarsXXX

Settings for the edit calendars dialog, individual attributes like CalendarsRepeatType. They are the same as Dates dialog.
Usual definition of the dialog is:
<Cfg CalendarsRepeatType="Enum" CalendarsRepeatEnum="||Weekly|Daily" CalendarsRepeatEnumKeys="||w|d" CalendarsValueType="Float" CalendarsValueFormat="0.00" CalendarsValueCaption="Count" />
new 8.0 <Cfg> type

CalendarsNameXXX

Sets attribute XXX of column Name in the Calendars Dates grid.
The column Name is used to show the calendar names in parent rows.
For example: <Cfg CalendarsNameType="Enum" CalendarsNameEnum="|Standard|Special" CalendarsNameButton="Enum"/>
new 8.0 <Cfg> string

CalendarsTitle

Title of the Calendars Dates grid, shown it top Space row.
new 10.0 API event void

OnDatesClose

(TGrid grid, TGrid dates, bool saved)
Called when the Dates dialog with calendars is closed.
grid is the source grid that opened the Dates dialog.
dates is the grid showing dates dialog.
saved is false if no changes were done in the Calendars, true is when something changed in Calendars.

Other settings

new 6.3 <C> int

GanttCheckExclude

[1] Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
If and how will be checked placing start of main bar, milestone, point on holidays. It does not affect run and flag.
0 - place to holiday, 1 - place to the first workday after, 2 - ask user
new 12.0 <C> int

GanttCheckExcludeEdit

[]
If set, overrides the GanttCheckExclude for editing (source cells) only. Possible values are the same.
new 8.0 upd 10.0 <C> int

GanttChangeExclude

[0]
How will be the main bars updated after the change of excluded dates, bit array. Permitted values are 0, 1, 4, 5
0 - The main bar duration will be updated according to the end date
1 - The main bar end date will be updated according to the duration

4 - If set, it changes dates of all objects to be outside the actually excluded ranges.

The Run is always changed according to its definition - if the bars are defined by end date or by duration.
new 9.1 upd 10.0 <C> bool

GanttExcludeComplete

[0]
If set to 1, the percentage complete in main bar (since 10.0 also Run) is shown exactly according to the excluded dates - it shows the date where the actually completion finished.
For example if the main bar is 10th - 16th (six days) and 11th - 13th (2 days) are excluded, the completion finishes at 13th for GanttExcludeComplete=0 as half of the six days, but for GanttExcludeComplete it finishes at 14th, as half of 4 working days plus the two excluded days before.
new 7.0 chg 8.0 API method void

ChangeExclude

(string exclude, string name, int type = GanttChangeExclude)
Changes given calendar and recalculates Gantt chart.
exclude is exclude string as in GanttExclude.
If name is not set, changes value of GanttExclude, otherwise changes the calendar name in Calendars array.
If the name is "GanttCalendar" it sets column GanttCalendar value to the exclude value, use it to disable / enable the custom calendars and recalculate Gantt.
The type can override GanttChangeExclude settings.
new 8.0 API method void

CorrectExclude

(TRow row, string col, bool show = 1, string objects = null)
Corrects given Gantt cell to current calendar. All object dates are updated to not be in excluded dates.
If row is null, it corrects all tasks in grid. col is Gantt column name.
If show is 0, it does not changes in the chart and the grid must be rerendered.
objects is comma separated list of objects to update. For null it updates all objects. It can be main, run, flags, points, constraints.
new 6.3 formula int

gantthasexclude

(string ganttcol)
Returns 0 if exclude is not defined, returns 1 if Exclude is shown, returns 2 if Exclude is hidden.