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

Master - detail grids

TreeGrid documentation

TreeGrid supports master / detail relationship as showing (master) row's children in different (detail) grid.
The detail grid can be shown outside the master grid, see External detail grids or inside the master grid, in some cell, see Nested detail grids.

The master grid contains all data and only master grid can upload changes to server.
Every master row (with Detail or DetailCol attribute) contains children that will be displayed in detail grid when the master row is chosen.

The detail children in master grid can be also created automatically by defining them as children of default row (<D>).
It is useful in creating master / detail relation for plain tables, where are the source data defined only once in the master root rows.

The detail grid contains only layout to define columns and fixed rows, but no variable data rows.
It is used to show and edit children of master row from master grid.
You can define data rows in detail grid to be displayed when it is empty - when does not display any master row's children.

It is possible to have completely different layout in detail grid than in master grid, use CopyTo attribute to provide correct relation between cells.

For classic master-detail relationship without tree you should specify MainCol='' and all master rows set Expanded='0'.
You can also use CopyTo attribute if you have editable cell in master row linked to cell in detail.

External detail grids

To define master / detail relationship, set <Cfg Detail='1' id='DetailGridId'/> in detail grid and <I Detail='DetailGridId'/> in master rows in master grid.
It is also possible to have a cascade of more related grids (detail grid can also be a master for another grid).
It is also possible to have one master grid with more detail grids or more master grids with one or more detail grids.

The way of master/detail relationship
The children (as in tree) of master row are displayed after focus/click/double click/expand in detail grid.
The children are still part of master grid's data and are downloaded / uploaded by master grid.
For the detail grid you need to specify the layout with empty data or with user row displayed when no data is shown in detail grid.
The layout of detail grid does not need to be the same as of master grid; you can add or hide other columns, but remember, uploading is done by master grid and only its columns are uploaded.
The rows can be dragged between master and detail grid.
One master grid can have more detail grids and one detail grid can have more master grids, but only one at a time.
The master and also detail grid can show data in tree, you can specify by Detail attribute which rows are shown as detail.

For more information see Master / detail tutorial.
upd 7.0 <I> string[ ]

Detail

Master row attribute
It is the main attribute for master / detail relationship in external grid.
Set it to id of detail grid where will be displayed the row's children. This means that every master row can be displayed in different detail grid.
Since 7.0 it can contain more ids, comma separated, to display the row's children in more detail grids.
<Cfg> bool

Detail

[0] Detail grid attribute
Set it to true for grid used as detail grid.
It is just support attribute to behave the detail grid slightly different - to not let users to add or drag rows into empty detail grid.
<Cfg> int

DetailOn

[1] Master grid attribute
Master grid attribute. When to show data in detail grid.
0 - disabled, 1 - on focus to row, 2 - on click to row, 3 - on double click to row.
For more options you can attach ShowDetail action to events like OnFocus, OnClickCel or OnDblClickCell.
<Cfg> int

DetailExpand

[0] Master grid attribute
What to do when expanding master row.
0 - show children in detail grid only
1 - expand the row only - the children will be visible only in master grid. The DetailOn should be 0 or 3.
2 - show children in detail grid and also expand the row - the children will be on two places in two copies and changes will be done to both.
<Actions>

ShowDetail ...FARO

Not attached to any event, master grid action
Shows data in detail grid for actual or focused row. It fails, if details grid already shows data for given row or the row is not master row.
This action is not attached to any event by default, because showing detail grid is controlled by DetailOn attribute.
<Actions>

RefreshDetail ...FARO

Not attached to any event, master grid action
Shows or refreshes data in detail grid for actual or focused row. It fails, if the row is not master row.
<Actions>

ClearDetail ...FARO

Not attached to any event, master grid action
Clears detail grid for actual or focused row. It fails, if the row is not master row.

Nested detail grids

It is possible to show the detail grid inside the master grid, in some cell of master row.
The master row should have set attribute DetailCol to the column name where to show the detail grid.

It is usually good to define the grid with <Cfg NoVScroll='1' NoHScroll='1'/> to always show the whole detail grid and avoid to have too many scrollbars.
To speed up the grid, it is good to define all columns in <Cols> section, to avoid a need of synchronizing row section heights. Define also <C Name='Panel'/> in the <Cols> to place panel here.
To correctly print the nested grid set PrintHeight of the detail row to the expected height of the nested grid.

For more information see Master / detail tutorial.
new 8.1 <I> string

DetailCol

Master row attribute
Name of column where (cell of the master row) to show the detail grid. All other cells in the master row will be normal cells with data.
This cell is usually spanned among other cells (see attribute Spanned and Span).
new 8.1 <I> string

DetailLayout

Master row attribute
Data source for downloading layout of the detail grid.
The detail grid data will be loaded from the master row children as usual for master / detail relationship.
It can be XML string, JSON string or URL. The URL cannot contain characters '<' and '{'.
The detail grid layout has predefined these default settings: <Cfg SuppressMessage='1' AbsoluteCursors='0' TabStop='0' NoVScroll='1' NestedGrid='1'/>
new 8.1 <I> string

DetailTreeGrid

Master row attribute
TreeGrid source tag of the detail grid. It should contain the <treegrid> / tag definition.
Useful to add some other setting to the detail grid.
For examples: DetailTreeGrid="<bdo Export_Url='Export.aspx' Export_Data='TGData' Export_Param_File='Test.xls'></bdo>" adds export settings to the detail grid.
new 14.0 <Cfg> bool

NestedFocusedActions

[1] Master grid attribute
If set, runs focused row manipulation actions like add, copy, indent, outdent and also expand all, collapse all in detail grid, if the action is called from master grid and detail grid row is focused.
new 8.1 API variable bool

NestedGrid

read only
Every nested detail grid has set this variable to 1.
new 9.3 API method void

RefreshNested

(TRow row)
Refreshes nested grid in given row. Use if the source data were changed.
Refreshes only already created nested grid.
new 14.0 API event bool

OnShowNested

(TGrid master, TRow row, object detail, object cell, string id)
Called before the detail nested grid is created or rendered. row is the master row.
If the nested grid already exists, the detail is the TGrid object of the detail grid to be rendered and id is null.
If the nested grid does not exist yet, the detail is the data Source to create grid from and id is the new grid id to be assigned to.
cell is the HTML tag of the master cell the detail grid will be rendered to, the cell is used as MainTag of the detail grid.
Return true to suppress showing the nested grid or for custom creating of the nested grid.

Synchronizing grids

Especially nested detail grids can be synchronized, to share the same configuration and / or size.
new 8.1 upd 11.0 <Cfg> string[ ]

Sync

Detail grid attribute
What settings to synchronize among selected grids - among all grids with the same SyncId value.
Comma separated list of keywords, case insensitive.
All (substitution for Sort,Filter,Group,Search,Cols,Style), Sort, Filter, Group, Search, Cols (size, visibility and position),
Sec (new 9.3, width of column section, see more information), Horz (horizontal scroll), Horz0, Horz1, Horz2 (new 11.0, horizontal scroll of individual section, 0 left, 1 mid, 2 right), Vert (vertical scroll),
Style (new 9.0, CSS style, size and scale, can be set also individually by SyncStyle), Zoom (new 9.3, Gantt zoom level and width), Language (new 14.0, Language and UseLanguages, can be set also individually by SyncLanguage)

All the grids should have the same columns to be synchronized successfully. All the grids should have the same Sync value to be synchronized in both ways.
For example if you change size of column 'X' in one grid, all the synchronized grids gets their column X resized to the same size.
Sync attribute can be used for not nested grids too.
new 8.1 upd 14.0 <Cfg> string

SyncId

Detail grid attribute
Only grids with the same SyncId will be synchronized by Sync.
Also all grids with undefined SyncId will be synchronized together.
Since 14.0 it is not permitted dragging rows between grids with different SyncId except if set Dropping = 2.
new 8.1 <Cfg> string

CfgId

Detail grid attribute
Under this name will be stored configuration to cookies.
Useful to set when more grids on page share the same configuration.
Set it the same for Sync='All', to let all the synchronized grids to use only one cookie.
Remember, all the grids should have the same layout to share their configuration.
new 14.0 <Cfg> string

SyncStyle

Detail grid attribute
If set, synchronizes CSS style, size and scale among all grids with same SyncStyle regardless on the Sync / SyncId attributes.

Other settings for master / detail grids

new 7.0 <Cfg> string[ ]

MasterDef

Detail grid attribute
Comma separated list of default row names that can be displayed in this detail grid.
Only rows their Def attribute is listed in the MasterDef are displayed in this grid.
Useful when displaying one master row in more detail grids or displaying master / detail in tree with normal children.
new 13.0 <Cfg> string[ ]

MasterDefHide

Detail grid attribute
Comma separated list of default row names that will be hidden in this detail grid.
Useful when displaying detail grid also as master grid, in 3 or more levels of master / detail in tree with normal children.
new 7.0 <Cfg> int

DetailRowsVisible

[3] Detail grid attribute
If the rows that are hidden in master grid will be shown in detail grid. Does not affect deleted rows.
0 - never
1 - only rows hidden by filter
2 - all hidden rows
3 - all hidden rows and all the rows will get also CanFilter=1
new 7.0 <D> int

AddDefChildren

[1] Master grid attribute
When the child rows defined in default (the <D> <I/><I/>... </D>) will be added to all rows using the given default.
0 - only when adding new rows with the default
1 - also on start to all rows without children
2 - also on start to all rows. If the row has children, the new children will be added before them
3 - also on start to all rows. If the row has children, the new children will be added after them
<cell> string[ ]

CopyTo

Master cell attribute
List of cells where to copy this value after it is changed.
It is comma separated list: row1,col1,row2,col2,... row is row id, col is column name
row can also be these special words:
Parent - parent row, Next - next sibling, Prev - previous sibling, Children - all children
Children_X - All children with specified default as X
Child_X - specific child, if X is number, it means child on specified position (from 0), if X is string it means the first child with specified default (Def attribute).
Sibling_X - specific sibling, it is the same as Child_X, but relative to parent row and not to this row.
Used usually in master / detail relationship to copy (detail) children cells to master row cells and vice versa.
Cross references are permitted, because the copying is applied only if value is changed to different value.
upd 8.1 API event bool

OnShowDetail

(TGrid master, TGrid detail, TRow row, TRow old)
Called before master row's children are displayed in detail grid, can return true to suppress action.
(Since 8.1) the old is original master row showed in the detail grid, the row is new master row to show in the detail grid.
API event void

OnShowDetailFinish

(TGrid master, TGrid detail, TRow row)
Called after master row's children are displayed in detail grid.
upd 12.0 API method bool

ShowDetail

(TRow row, string detail_grid_id, bool test = 0)
Shows the master row's children in the given detail grid.
Returns true for success.
Since 12.0 if set test = 1, it does not change anything, just tests if it is possible.
API method void

RefreshDetail

(TGrid grid, bool clear)
Refreshes the given detail grid according to its actual master row's children.
If grid is null, refreshes all detail grids on page.
Refreshes only actually loaded detail grids - grids that have actually attached its master row.
If clear is true, clears the grid and removes the relation to the current master row.
new 8.1 API method TRow

GetMasterRow

( )
Detail grid method. Returns row from master grid that is actually shown in the detail grid or null.
new 11.0 API method TGrid

GetDetailGrid

(TRow row, int idx = 0)
Master grid method. Returns detail grid or nested grid shown for given master row.
If there are more grids shown for the row, the idx specifies the requested one.