News in version
TreeGrid Gantt chart SpreadSheet Examples Documentation Download Development Licensing Prices References Contacts Buy Try it free
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 React Vue Other frameworks NodeJS server

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

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


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

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
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 (like Adobe Flash) 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

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 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

Debugging and testing

TreeGrid documentation

Debug window

TreeGrid since 6.0 contains new feature for debugging: a debug window.
The window shows various information from TreeGrid runtime. Errors, warning, timer, status and so on.
This window is displayed on bottom of page by default, the position can be changed in Grid.css, CSS attribute GridDebugTag.
The window is shown automatically if some message is printed or on click to Debug icon on toolbar.
What will be printed to the debug window is controlled by <treegrid> / <bdo> attribute Debug.

To turn off the debug set <treegrid> / <bdo> Debug=""
To print the information to browser console instead of debug window set <treegrid> / <bdo> DebugTag="Console".
new 6.0 <treegrid,bdo> string[ ]


Global debugging settings.
A list of comma separated keywords specified what information will be printed to the Debug window. The keywords are case insensitive.
Default setting of Debug is to print all errors and warning, it strongly recommended to use at least this settings during development!
In final release you should set Debug="" to disable debugging.

ErrorPrints errors (red , if something failed in grid - data communication, action, formula) and fatal errors (big red, TreeGrid cannot render)
ProblemPrints warnings (brown, something is wrong in TreeGrid, but it may or may not have influence on running), errors and fatal errors
InfoPrints status (black, something started, something finished, something called), timers (black, profiling information), warnings, errors and fatal errors
CheckChecks all input XML attributes and prints all unknown attributes that are not used by TreeGrid
 It is useful when upgrading to see unsupported attributes and also to find typing errors.
 Remember, it can do false alarms if you use custom grid, row, col, cell attributes, you can define them in DebugCheckIgnore.
 This option can remarkably slow down data loading in large grids!
IOErrorLists input / output data from erroneous communication
IOLists all input / output data. Sets *_Debug="In,Out" for every data source that has not set its Debug attribute, except Defaults and Text.
CookiePrints all information about grid configuration loaded from cookies.
PagePrints status information for downloading pages, cells (DefaultsServer), AutoUpdate
EventAll mouse over events to see what part in grid is marked by what action event name. Useful for attaching events. Very talkative.
new 6.0 <treegrid,bdo> string[ ]


Debugging settings for appropriate data source (e.g. Upload_Debug="Out")
A list of comma separated keywords specified what information will be printed to the Debug window. The keywords are case insensitive.

InLists all input XML downloaded from server
OutLists all output XML uploaded to server
RawLists all output XML directly as it is uploaded to server
new 6.0 <treegrid,bdo> string[ ]


Comma separated list of all attributes that Debug["Check"] will ignore.
These attributes will be ignored for every tag except <treegrid> / <bdo>.
These attributes are also ignored for every cell.
new 6.0 upd 12.1 <treegrid,bdo> string


An id of existing tag on HTML page to print the debug information to.
If not set, default TreeGrid debug tag is created and used.
Since 12.1 If set to "Console", it prints the debug information to browser console.
new 6.1 <treegrid,bdo> string


Name of new window to print debug list to another window instead of DebugTag.
new 6.0 <treegrid,bdo> bool


If set to 1 it alerts a message to user when communication with server failed.
new 6.1 API method void


(int type, string arg1, string arg2, string arg3,...)
Prints information to the TreeGrid Debug window
type is 0 - fatal error, 1 - error, 2 - warning (shown when Debug contains Problem), 3 - list (shown always), 4 - info (shown when Debug contains Info).
The arg are strings to display, are shown without any separator, every even string is displayed bold.
new 9.0 API event bool


(TGrid grid, int level, type[ ] arguments)
Called for every debug print, regardless on debug level, except input / output data.
Return true to suppress default action.
Can be used for redirecting the debug prints to another output.
level is debug level (importance), like type in Debug function.
arguments is array of the printed strings, the first item is also the level.
new 7.0 <Actions>


Attached to OnCtrlAltD event
Prints to new window all actions done from last clearing undo. Prints only actions that can be undone.
It prints the actions as calling API methods, so the developer can easily redo the actions by simply adding the list to the script.
Works only when set <Cfg Undo='1'/> and Debug contains "Error".
It can be used when reporting bugs, to get the action list that led to incorrect behavior:

When you face some incorrect behavior during testing, press Ctrl+Alt+D to show the window.
Click to Test button to reload grid and to do automatically all the actions again.
If the problem rises again, it means it can be simulated by this action list.
Press again Ctrl+Alt+D and select and copy all the message text to clipboard and send it to developer with all the example data to simulate the bug.
new 15.0 global variable int


If set, encloses all TreeGrid functions to try / catch block to catch all exceptions in TreeGrid code.
It encloses also all TreeGrid event handlers (set to Grids.On...) and also all global window functions.
If the exception is thrown, it is caught and alerted.
If set to 2, the caught exception is logged to console.
It must be set before document is fully loaded or StartTreeGrid must be called after.
Useful to find out all errors in TreeGrid code due incorrect API usage and errors in custom API events, especially on devices without JavaScript debugger.

Automated testing

new 10.0 <Cfg> bool


If set to 1, many TreeGrid and Gantt HTML elements get unique id attribute to be accessible by automated testing tools like Selenium WebDriver.
It is strongly recommended to use the ids only for testing, not for controlling the TreeGrid HTML - for it use API instead.

The id has mostly this syntax: TGname-grid-row-col-part, where
name is the TreeGrid internal name of element,
grid is grid index (starts from 0 for first grid on page),
row is row id attribute,
col is column name,
part is specific identification of the element, usually its index inside its cell
- is a separator defined by TestIdSeparator, be default it is '-'.

Every cell, including header and space cells, gest id: TGCell-grid-row-col
The cell is <td> tag and includes also its side Icon (e.g. the Enum or Filter icon). It does not include its side Button (e.g. calendar, defaults or sort buttons) and tree button.

Because the side Icon is included in cell and cannot get its separate id, you can use for testing purposes right side Button instead of the Icon.
For Enum do <C Type="Enum" Icon="" Button="Enum"/>. For filter row do for every related cell <Filter Col1Button="Filter" ... />.

Every cell right side Button gets id: TGButton-grid-row-col
The id is attached to the <td> tag containing the button or icon.

Every tree part gets id: TGTree-grid-row-col
The id is attached to the <td> tag containing the whole tree part, not only the expand/collapse buttons.
For testing purposes you can attach the Expand / Collapse actions to the whole tree part by: <Actions OnClickTree="Expand OR Collapse" OnDblClickTree="Expand OR Collapse"/>

The resizing grid button (placed bottom right in the grid) gets id: TGResize-grid. In IE quirks mode there will be also defined TGResizeIE-grid for parent tag.

The <input> or <textarea> tag shown for in-cell editing in grid gets id: TGInput-grid.

In Gantt chart there are defined these ids:
Main bar: TGMainplan-grid-row-col-index; plan is number of plan, 0 for the first plan
Main bar side icons: TGMainplanSideIcon1-grid-row-col-index; TGMainplanSideIcon2-grid-row-col-index
Main bar side manual constraint: TGMainplanSideManual-grid-row-col-index;
Main bar side html: TGMainplanSideLeft-grid-row-col-index; TGMainplanSideRight-grid-row-col-index
Run bar: TGRun-grid-row-col-index
Run bar side manual constraint: TGRunSideManual-grid-row-col-index;
Run bar side html: TGRunSideLeft-grid-row-col-index; TGRunSideRight-grid-row-col-index
Flags icon: TGFlag-grid-row-col-index;
Flags text: TGFlagText-grid-row-col-index
Points: TGPoint-grid-row-col-index
Constraints: TGMinStart-grid-row-col, TGMaxStart-grid-row-col, TGMinEnd-grid-row-col, TGMaxEnd-grid-row-col
Gantt Base: TGBase-grid-col
Gantt Finish: TGFinish-grid-col
Gantt Header cell: TGGanttHeader-grid-col-index-date, where index is the GanttHeader index from 1 and date is starting date of the cell in milliseconds since 1/1/1970
Paged Gantt Header line: TGGanttHeaderPage-grid-col-index (defined only in GanttPaging when the header line is paged by GanttHeaderPaging)

In side pager there are defined these ids:
Every pager page gets id: TGPager-grid-name-index, where name is name of the pager and index is the pager page index from 0.
The pager caption gets id: TGPagerCaption-grid-name.

Every link to page in Pages type cell get id: TGPages-grid-row-col-page, where page is the index (from 1) the link points to.

Every item in DropCols type cell get id: TGDropCols-grid-row-col-index. The Text part of the DropCols get id: TGDropColsText-grid-row-col

In popup calendar dialog there are defined these ids:
Every calendar date button has this id: TGCalendar-grid-type-date, where type is: "WD" as workday, "Sa" as Saturday, "Su" as Sunday, "OM" as other month day, "Now" as today, "Sel" as selected day. date is date of the day as count of milliseconds since 1/1/1970
The time <input> gets id: TGCalendarTime-grid.
The empty button gets id: TGCalendarEmpty-grid.
The control buttons get ids: TGCalendarOk-grid, TGCalendarClear-grid, TGCalendarToday-grid, TGCalendarYesterday-grid.

In popup menu dialog (used by Menu, Enum Defaults, CfgMenu, Columns, ...) there are defined these ids:
Every menu item gets id: TGMenu-grid-itemid, where itemid is the id attribute of the item. If the menu item has not defined its id, it is its Name or Text with replaced all white characters by '_'
Every submenu item gets id: TGMenu-grid-submenuindex-itemid, where sumbenuindex is 1 for first submenu, 2 for the second submenu, etc..
The control buttons get ids: TGMenuOk-grid, TGMenuCancel-grid, TGMenuClear-grid.
The control buttons in submenu get ids: TGMenuOk-grid-submenuindex, TGMenuCancel-grid-submenuindex, TGMenuClear-grid-submenuindex.

The custom scrollbar (set by <Cfg CustomScroll/>) buttons get these ids: TGScrollUp-grid, TGScrollDown-grid, TGScrollLeft-grid-sec, TGScrollRight-grid-sec, where the sec is "Left", "Mid" or "Right"

Other internal ids used by TreeGrid: TGFastColumns-grid, TGHoverCursors-grid, TGFocusCursors-grid, TGTmpFocusGrid-grid
Special global internal ids: TreeGridStyle-prefix (the prefix is e.g. 'TS' for Standard style), TreeGridMessageStyle, TreeGridControls
new 10.0 <Cfg> string


Separator used in TestIds. Define it different is some your row id or column name contains the '-' to some character not used in any your row id and column name.