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

Paging in tree

TreeGrid documentation

ChildPaging - download or render children on expand

In tree you can render or download children on background when their parent is being expanded at first time (or even next times).
The parent row must be collapsed to be paged. You have to set its Expanded attribute to 0.
To send all rows collapsed you can set for default row named "R": <Def><D Name='R' Expanded='0'/></Def>
The maximum of children in row is limited, because all the children are rendered at once. By default there can be 1000 children. If the count of children overruns this limit, the children are divided to newly created rows. See row's attribute MaxChildren.
An alternative to client ChildPaging are also ChildParts.
In tree you can of course use also standard paging for root rows.
upd 7.0 <Cfg> int


Method of paging of children rows in tree. How will be rendered or downloaded children rows after parent is expanded for the first time.
Remember, default setting is 2 - client paging.

0No Paging
All rows, including all children are rendered on start.
This means slow start and fast use.
The rendering on scroll by ChildParts is still applicable, but limiting children count by MaxChildren is ignored.

1not applicable

2Client paging (render on expand)
Rendered on start are only children of expanded rows. Children of collapsed parent are rendered on first access.
This means faster start for collapsed tree, but slower first expanding of collapsed node.
The client paging is fully done by TreeGrid.

3Server paging (download and render on expand or on scroll)
Children of collapsed rows are downloaded on first expand. Server must be able to send the children of the row.
Since 7.0 also the children of expanded rows can be downloaded from server when they become visible due scroll.
See server paging documentation.
The server paging requires cooperation with server and you are responsible for sending children from server.
For server application you can use also TreeGrid.dll/so.
new 14.0 upd 15.0 <Cfg> int


Only for ChildPaging=3. To download many immediate children in parts only for demand. See ChildPageLength in server paging doc.
<Cfg> int


If rendered children are removed when parent row collapses. To speed up grid with many collapsed rows.

It does not remove the children, just hides them. The next expanding is faster.

1not applicable

2Html (render on next expand will be needed)
The rows are removed from html page only and stay in data unchanged.
It can be set only for client or server ChildPaging (2 or 3).
The next expanding is as slow as the first.
It speeds up grids with many rows that were expanded and back collapsed, to not have too many HTML tags rendered.

3Data (download and render on next expand will be needed)
The rows are removed from both html and data.
It can be set only for server ChildPaging (3).
Changes in speed are the same as for value 2 (Html).
This setting can be used when children are generated dynamically to regenerate new children in every expanding.
The unsaved changes in all children are lost! Also all selection is lost.
API event void


(TGrid grid, TRow row)
Called when the row is collapsed and its children are deleted from data, only if set <Cfg RemoveCollapsed='3'/>.
new 9.3 <Cfg> int


How will behave changed rows on RemoveCollapsed or RemoveUnused.
0 - Don't remove changed rows and selected rows. If there is any such row, the removing is not done.
1 - Don't remove changed rows. If there is any such row, the removing is not done.
2 - Remove changed rows.
3 - Save changes and remove rows immediately.
4 - Save changes and wait for the server success response before removing rows.
new 9.3 API event int


(TGrid grid, TRow page)
Called if removing page containing some changed (or selected row for RemoveChanged==0)
For RemoveChanged==2 is called always.
Return new value for RemoveChanged to use - 1, 2, 3, 4
API event void


(TGrid grid, TRow row)
Called before rendering of the root page or child page started rendering.
When used child paging (<Cfg ChildPaging>), this event is fired before start of rendering children when a parent row is being expanded.
API event void


(TGrid grid, TRow row)
Called after the root page or child page is fully rendered and ready.
When used child paging (<Cfg ChildPaging>), this event is fired after children are rendered when a parent row is being expanded.
API TRow var. int


Page or parent row state of loading / rendering its children.
0 - not yet loaded, 1 - children are loading, 2 - children are loaded, but not rendered, 3 - children are rendering, 4 - fully rendered.

MaxChildren - limit children count

Applied only when used child paging (ChildPaging>=2), (by default is ChildPaging='2').
Expanding rows with too many children can be very slow.
You can limit the maximal count of immediate children by row's attribute MaxChildren.
If the row children exceed this count, in row's children are automatically created new collapsed rows that will contain the row's children.
Since 7.0 the attributes of the creates temporary parents are read from the default row named CPage (<D Name='CPage'/>).
Sorting, filtering, grouping and calculations will still work with all the children like they were not moved.
An alternative to MaxChildren are also ChildParts.
<I> int


Maximal count of row's children. Applied only when used child paging (ChildPaging>=2).
Default value 10000 is very high and nearly disables the feature.
If the count of children exceeds this limit, in row are created sub nodes that contain parts of the children list.
This means that if MaxChildren is 1000 and row contain 3500 children, there will be created four sub nodes with 3x1000 and 1x500 children rows.
The text displayed in child page is in <Grid><Lang><Text Items='...'/></Lang></Grid>.
<I> int


The children rows are grouped to sub nodes only if their count exceeds MaxChildren + MaxChildrenDiff.
To avoid creating sub nodes with 1000 + 1 node or so.
new 9.3 <I> int


Minimal length of the group. To avoid creating sub nodes with 1000+1000+1.
The last group with less children than the MaxChildrenMin is merged with previous group.
renamed 6.0 <Cfg> bool


Used when the count of children exceeds MaxChildren value and in row are created children pages.
If the child page row shows all values of its parent [0] or shows only value in main cell [1].
new 13.3 API event void


(TGrid grid, TRow row)
Called when created new MaxChildren parent row, before it is displayed.
Use it to preset row values, especially in main column that cannot be calculated in this row.
For example to show the first and last child value in the main column:
Grids.OnCreateCPage = function(G,row){ row[G.MainCol] = row.firstChild[G.MainCol] + " - " + row.lastChild[G.MainCol]; }

ChildParts - rendering children parts on scroll

Because standard paging is applied only on root rows, in deep tree the root page can be very long and the root paging become ineffective.
It is possible to render parts of child rows only on scroll, similarly to root paging (by default it is permitted, see ChildParts).
You should play with ChildPartLength and ChildPartMin to get the best settings for your tree - for different tree structures different settings are the best.
Remember, the child part length is applied only to immediate children, not for sub nodes, so for deep slim tree you should set ChildPartMin='0' to take the child parts its effect.
new 6.0 chg 7.0 <Cfg> int


Since version 7.0 the original and also default value 1 was changed to 2 to be compatible with other paging types (Paging, ColPaging, ChildPaging).
If set to 0, all children are rendered on expand or on start for all expanded parents.
(new 7.0) If set to 1, all children are rendered on expand or on start for all expanded parents, but with progress dialog and is possible to cancel the rendering and render it on demand.
(in 7.0 was changed from 1) If set to 2, it renders only visible (by scroll) parts of expanded children, similarly when paged root rows with all pages displayed.
On start or first expand of the children it renders only few rows (set by ChildPartMin) and next actually visible child rows renders when grid is scrolled and the part become visible.
By default it is set to 2 in grid with more than 200 children and in grids with server paging or server child paging.
new 6.0 <Cfg> int


Count of rows in one part for ChildParts. The part is rendered whenever is (at least partially) visible by scroll.
Remember, the child part length is applied only to immediate children, not for sub nodes, so for deep slim tree you should set ChildPartMin='0' to take the child parts its effect.
new 6.0 <Cfg> int


Minimal count of rows rendered immediately the parent row is expanded or rendered expanded.
It can be also 0 to not render anything immediately - it is should be set in deep slim tree.
new 7.0 <Cfg> int


Maximum rendered child parts in grid, only for ChildParts = 2.
When grid contains more rendered child parts, the child parts longer not accessed are cleared (only in HTML, data are not affected).
Used to not slow down the browser when too many HTML tags are displayed.
For large child parts you can lower this value.
The actually displayed child parts are never cleared.
Set it to 0 to disable clearing child parts.
new 9.0 <Cfg> int


If set to 0, it never removes unused root pages, child pages/parts and column pages.
If set to 2, it removes unused pages due MaxPages, MaxChildParts and MaxColPages.
If set to 3, it removes also data of unused root pages or child pages.
It removes only page or child page that does not contain changed rows.
new 12.0 <Cfg> int


If the fixed left and right column sections will be removed when removing unused row pages by MaxPages or MaxChildParts.
0 - none, 1 - left, 2 - right, 3 - both
new 9.3 <Cfg> int


How will behave changed rows on RemoveCollapsed or RemoveUnused.
0 - Don't remove changed rows and selected rows. If there is any such row, the removing is not done.
1 - Don't remove changed rows. If there is any such row, the removing is not done.
2 - Remove changed rows
3 - Save changes and remove rows immediately
4 - Save changes and wait for the server success response before removing rows.
API event void


(TGrid grid, TRow row, int index)
Called before rendering of a part of children is started rendering.
The index is an index of the part from 0.
API event void


(TGrid grid, TRow row, int index)
Called after the part of children is rendered and ready.
The index is an index of the part from 0.
new 9.0 API event void


(TGrid grid, TRow page)
Called after removing data from page or child page, when set RemoveUnusedPages = 3.
new 9.3 API event int


(TGrid grid, TRow page)
Called if removing page containing some changed (or selected row for RemoveChanged==0)
For RemoveChanged==2 is called always.
Return new value for RemoveChanged to use - 1, 2, 3, 4