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

Row id - identification on server

TreeGrid documentation

The rows must be somehow identified on server for uploading changes to server and for server paging.
The rows in TreeGrid are identified by id attribute, this attribute is always sent to server in every request.

To be sure what id the rows have, you can define new id column <C Name='id'/>.

Setting row id attribute

This is the basic option. Set id attribute of every row to unique string. By default this string can contain only letters and '_'. It can be changed by IdChars.
New row will get new id generated from the same characters.
The new generated id is always the highest id in the grid.
If row has neither set its id nor generated according to IdNames, it automatically set to "R"+number from 1.
<I> string

id

Both letters lowercase!
Unique ID of the row.
Set it in input XML for every row. It can contain only characters defined in <Cfg IdChars />.
For new rows it will be automatically generated from the characters defined in <Cfg IdChars />.
The id attribute must not be changed by API.
<Cfg> string

IdChars

["_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"]
Accepted characters when generating new id. In this order.
Example for the default setting: if the last id was "ab" the next id is "ac", for "az" is "b_", for "zzz" is "____".
<Cfg> int

NumberId

[0]
Set it to 1 for generating number ids. And set IdChars = '0123456789'. This attribute says, that the id cannot start with 0.
In fact, this attribute says, that id cannot start with count of NumberId characters from start of IdChars.
The start from some higher number than 0 set LastId attribute.
<Cfg> string

IdPrefix

This string is inserted before generated new id (before the last part).
In this case all ids in XML must contain this prefix.
<Cfg> string

IdPostfix

This string is appended at the end of generated new id.
In this case all ids in XML must contain this postfix.
<Cfg> string

LastId

Last (maximal) id when used server paging or server child paging, to not generate duplicated ids on client.
Can be used only when IdNames contains only one item!
New generated id (of new added row) will get next id.
If IdPrefix and / or IdPostfix are used, the LastId attribute can, but need not contain them.
new 12.1 <Cfg> int

DuplicateId

[0]
What to do if two rows have the same id. Bit array.
1. bit&1 For 0 it generates unique id of the actual row that's id is being set. Default behavior.
For 1 it generates unique id of the old row that collides with the new row. Useful when changing more row ids by <Changes> tag and rows can get duplicate ids temporary.
2. bit&2If set, does not show warning about duplicate row id.
3. bit&4If set, applies the DuplicateId also when loading data.
upd 9.1 <I> string

NewId

New row id returned from server.
To change row id attribute from server you cannot set it directly, because the row will not be found, you need to set it to NewId.
The server should return the new row id in save response in <Changes> tag like: <Grid><Changes><I id='orig id' Changed='1' NewId='new id'/></Changes></Grid>
(Since 9.1) It is set also in uploaded data if the row id will be changed due IdNames or FullId settings. Only when set Upload_Flags='NewId'
new 7.0 <Cfg> string

AutoIdPrefix

["AR"]
This string is inserted before every automatically generated id.
For every row without id is created unique number id from 1 with this prefix: AR1, AR2, AR3 ...
The number is increased for every row and is never restarted, except reloading whole grid by Reload method (but not ReloadBody).
new 11.0 API variable int

AutoId

The automatically generated id that will be get by the next new row. Starts on 1 and is increased after any new row added.
Change it carefully to never generate duplicate ids.
new 7.0 <Cfg> string

GroupIdPrefix

["GR"]
This string is inserted before automatically generated id for group rows.
For every group row is created unique number id from 1 with this prefix: GR1, GR2, GR3 ... It is independent on AutoId for normal rows.
The id number is set back to 1 on every grouping change.
new 8.0 <Cfg> int

GroupIdValue

[0]
For 0 it creates the group row ids as GroupIdPrefix + ascending number
For 1 it creates the group row ids as column name + GroupIdPrefix + grouping value
For 2 it creates the group row ids as column name + GroupIdPrefix + first child row id
For 3 it creates the group row ids as row Level + GroupIdPrefix + grouping value
For 4 it creates the group row ids as row Level + GroupIdPrefix + first child row id
new 7.0 <Cfg> string

ChildIdPrefix

["CR"]
This string is inserted before automatically generated id for child page rows (created by MaxChildren attribute).
For every child page is created unique number id from 1 with this prefix: CR1, CR2, CR3 ... It is independent on AutoId for normal rows.
The number is increased for every child page and is never restarted, except reloading whole grid by Reload method (but not ReloadBody).

Row id in tree

In tree you can identify rows according to their parents by setting FullId.
<Cfg> bool

FullId

[0]
If set to 1, row id contains all its parent ids as id prefix, separated by '$'.
In input XML the ids can be full or only parts. If the id is only part, it is updated on load and for API it is always full.
If parent id is "R1" the input row id can be "R2" or "R1$R2", for upload and in API is the id always "R1$R2".
For example: <I id='1'> <I id='1-1'/> <I id='1-2'><I id='1-2-1'/></I></I> will be replaced as full ids:
<I id='1'> <I id='1$1-1'/> <I id='1$1-2'><I id='1$1-2$1-2-1'/></I></I>. Or you can set it straight in the input XML.
If row is moved, the id attribute is not changed immediately, it is updated after server accept the changes.
upd 9.1 <I> string

NewId

New row id returned from server.
To change row id attribute from server you cannot set it directly, because the row will not be found, you need to set it to NewId.
(Since 9.1) It is set also in uploaded data if the row id will be changed due IdNames or FullId settings. Only when set Upload_Flags='NewId'

Using one or more (editable) columns as row identity

As row identity (like database primary key) you can use any row attributes or column names set to IdNames.
If used editable columns as id source, the last attribute in IdNames is automatically updated to be the primary key always unique.
The row id attribute is generated from these attributes, so on upload and in API you can use this id attribute.

All the primary keys set in input XML must be unique!
The values in the last attribute from IdNames must contain only characters from IdChars or must be set AppendId='1'.
The row attribute id is changed only after server accepts changes, never on source attribute value change!

<Cfg> string[ ]

IdNames

["id"]
Comma separated list of attributes fully identifies the row, these attributes are like unique primary key in database table.
The list can contain column names, attributes like Def or any user defined row attribute, but must not contain the id attribute itself.

The row id attribute is automatically created from the attribute values from the list, separated by '$'. If any value contains '$', it is replaced by '_'.

The last attribute in list is specific, because its value is generated automatically for new rows from IdChars, IdPrefix and IdPostfix.
If the list item is editable column and its value is changed, there is possibility that the id will not be unique.
In this case the last attribute value is re-generated (before changes are sent to server).
After changes are sent to server, the row id is updated according to changed attribute (column) values.
Remember, after a user changes the source of id, the id attribute itself is not changed, it is changed after server accepts the changes.

When new row is added, the last attribute value is generated to ensure the id to be unique.
<Cfg> bool

AppendId

[0]
When a user changes some editable cell as source id part and the id becomes not unique:
if set to 0, the last attribute in IdNames is automatically re-generated.
if set to 1, the generated id is appended to the existing value in the last attribute in IdNames.
When new row is added, the cells get default values and if the row id becomes not unique:
if set to 0, the last attribute in IdNames is set to new generated id.
if set to 1, the generated id is appended to the default value in the last attribute in IdNames.
renamed 6.0 <Cfg> bool

CaseSensitiveId

[1]
How to compare ids if they are unique.
If used case insensitive ids, all the ids are always lower case.
new 9.3 <I> bool

IgnoreIdNames

[0]
If set to 1, this row does not set its id by IdNames. Use for auto generated rows like group rows with auto set ids.
<Cfg> bool

FullId

[0]
If set to 1, to row id there are added all its parent ids as id prefix, separated by '$'.
It means that the row primary key must be unique only within its parent.
If row is moved, the id attribute is not changed immediately, it is updated after server accept the changes.
upd 9.1 <I> string

NewId

New row id returned from server.
To change row id attribute from server you cannot set it directly, because the row will not be found, you need to set it to NewId.
(Since 9.1) It is set also in uploaded data if the row id will be changed due IdNames or FullId settings. Only when set Upload_Flags='NewId'

API for row ids

API event string

OnSetRowId

(TGrid grid, TRow row, string newid)
Called when new id attribute is generated for the row. Returns new id. The row has still old id.
The newid and returned id is value for row id attribute. It is full id, includes all parts and optionally parent id.
It is called when new row is added or row is copied or server returns NewId for the row or the id is changed by accepting changes.
API event void

OnChangeId

(TGrid grid, TRow row, string col, type oldvalue)
Called when the id column (the last column in IdNames) value has been automatically changed to be the id unique.
Called after a user changed some cell from IdNames and row id became non unique and has been automatically corrected.
Called also after row move when set FullId and the id became non unique due the move to another parent.
It is called after the change, the row contains new value in the column, the oldvalue is original value.
API event string

OnGenerateId

(TGrid grid, TRow row, string newid)
Called when new unique part of id is generated or updated for the row. Returns new id value.
The newid and returned id is the generated part of id, this is the value for the last attribute from IdNames list.
API method string

GenerateId

(TRow row)
Generates new row's id and saves it to LastId. Returns it. The id is only the last part for multi ids.
It does not change the row id.
new 6.0 API variable TRow[ ]

Rows

read only JavaScript named array of row objects by their id
All rows in grid by their id. Including fixed and Space rows.
If the row has set its id neither in XML nor by IdNames, the id is automatically generated as "AR"+number from 1.
upd 7.0 API method TRow

GetRowById

(string id, string attr, bool nofixed)
Searches for the row by its id.
If the row exists in Rows, it returns the row from Rows, otherwise it iterates all rows in grid to find the row.
The advantage to Rows is that it can be used also before the Rows array is filled during grid creating.
The disadvantage is that it will be slow when the Rows does not contain given id.
(Since 7.0) If set attr, it searches the row according to this attribute value instead of id, in this case it always iterates all the rows.
(Since 7.0) If set nofixed, it does not search in fixed and space rows