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

Cell spanning

TreeGrid documentation

Cells in TreeGrid can be spanned horizontally among columns, vertically among rows or in both directions together.
Since version 7.0 it is not possible to cross vertical and horizontal span, it is possible only to span rectangular areas.

Horizontal spanning among columns

Cells cannot be spanned between column sections (Left, Mid, Right).
It is possible to drag column into spanned range, the dropped column will get the span setting from the range.
It is possible to drag column outside spanned range, the dropped column will loose its col span and the cells become displayed.
It is possible to drag column inside the spanned range.
If you permit column moving between spanned columns, you should forbid saving the changes to cookies by <Cfg ColsPosLap='1'/>.
If grid contains any spanned cells between columns (<I Spanned='1'/>), the column moving is done by re-rendering whole grid.
<I> bool

Spanned

[0]
If the row contains any horizontally spanned cells among columns (marked with Span attribute).
Every row that contains some spanned or merged cells among columns must have set Spanned="1", otherwise the cell Span, Merge or MergeEdit attributes will be ignored.
upd 6.0 <I cell> int

Span

[0]
The name is not ColSpan, but Span only!
For horizontally spanned cell among columns, how many cells it covers, at least one. Including hidden columns.
The row with spanned cell must have set Spanned='1', otherwise the attribute is ignored.
In the whole spanned cell is shown value of this column. It can be changed by Merge attribute.
chg 6.0 <I cell> string[]

Merge

To show more or other values in one cell. A comma separated list of column names to show in the cell.
The row with merged cell must have set Spanned='1', otherwise the attribute is ignored.
The cell will show values from all the row cells from the columns listed. The way of showing is specified by MergeFormat and MergeType.
The attribute is intended to show more values in spanned cell, but can be used also for display other or more values in any cell.
This attribute is ignored in export to Excel.
new 6.4 <I cell> string

MergeFormat

If set, it specifies full HTML for display the merged values. The column names are replaced by the cell values.
If not set, the cell values are merged in <table> according to the 1. bit of MergeType.
For example "Path/Name.Ext" can be used for file path, where Path, Name and Ext are column names.
new 6.4 <I cell> string

MergeFormatXXX

Special MergeFormats used for particular Merge columns combination when some of the cells are empty.
Can be used to better specify what will be excluded from format instead of MergeType='4'.
The XXX are column names that are not empty for this row in the same order as in Merge.
For example for Merge='Path/Name.Ext' can be MergeFormatNameExt used when Path is empty.
new 6.4 <I cell> string

MergeFormatEmpty

MergeFormat use when all merged cells are empty.
new 6.4 <I cell> string

MergeEditFormat

MergeFormat used for editing. Set it especially when MergeFormat contains HTML code. If not set, the MergeFormat is used instead.
new 6.4 <I cell> string

MergeEditFormatXXX

Special MergeEditFormats used for particular Merge columns combination when some of the cells are empty.
Can be used to better specify what will be excluded from format instead of MergeType='4'.
The XXX are column names that are not empty for this row in the same order as in Merge.
For example for Merge='Path/Name.Ext' can be MergeEditFormatNameExt used when Path is empty.
new 6.4 <I cell> string

MergeEditFormatEmpty

MergeEditFormat use when all merged cells are empty.
new 6.4 API event void

OnMergeChanged

(TGrid grid, TRow row, string col, string val, string[] result)
Called after the cell with MergeFormat is edited. The val is the edited string, the result is default parsed val into array of cell values.
The order in result is the same as in MergeEditFormat.
Fill the result with new values if the value needs special parsing. Remember, the result has already filled its items.

For example, to parse file path in order Path, Name, Ext use such handler:
Grids.OnMergeChanged = function(G,row,col,val,res){
var idx = val.lastIndexOf("/");
if(idx>=0){ res[0] = val.slice(0,idx); val = val.slice(idx+1); } else res[0] = "";
var idx = val.lastIndexOf(".");
if(idx>=0) { res[1] = val.slice(0,idx); res[2] = val.slice(idx+1); } else { res[1] = val; res[2] = ""; }
}
chg 6.0 <I cell> string

MergeEdit

Used only without MergeFormat set. Specifies the one cell value that can be edited in merged cell. Only one value in merged cell can be edited without MergeFormat.
It is a column name. This column should be listed in Merge array.
The row with merged cell must have set Spanned='1', otherwise the attribute is ignored.
upd 6.4 <I cell> int

MergeType

[0]
Various flags for merging cells, bit array.
1. bit (&1) 0 - (only without MergeFormat) merged cells are displayed in one line (horizontally), 1 - merged cells are displayed in more lines (vertically)
2. bit (&2) 0 - if column is hidden, its cell value is removed too, 1 - all merged cell values are always visible regardless of column visibility. See FastMerge.
3. bit (&4) 1 - (only for MergeFormat) remove separated part after empty value (for the last column before empty value).
new 6.0 <Cfg> bool

FastMerge

[1]
If set to 1, ignores MergeType&2 (takes it as 1) for all cells when showing / hiding column.
It is faster, because the merged cells do not need to be refreshed.
<I> bool

SortSpan

[0]
Controls sorting in Spanned row.
By default, the grid sorts spanned rows always according to value in sorted column, even if this is invisible due spanning.
You can set values in these columns for spanned rows to support sorting in the way you want.
Or you can set SortSpan = '1' and row will be sorted always according to spanned column's value.
new 6.0 <I> string

LeftHtml

You can span the whole left column section and show here any HTML code.
All cell values in the section will be ignored.
new 6.0 chg 7.0 <I> string

MidHtml

You can span the whole variable column section and show here any HTML code.
All cell values in the section will be ignored.
(Version 7.0) For cell paging it is shown only on the first column page, on the next ones is shown MidHtml2.
new 7.0 <I> string

MidHtml2

For ColPaging the user section is spanned only through the one page, this value is shown on the second and next column pages in the middle section.
new 6.0 <I> string

RightHtml

You can span the whole right column section and show here any HTML code.
All cell values in the section will be ignored.
new 6.0 <Cfg> bool

SpannedTree

[0]
Set to 1 if some MainCol cell is spanned between columns (has set Span attribute).
If set to 1, it shows tree icons in included <table> tag and slows down rendering.
Cannot be used when the main column cells have set RowSpan.
renamed 9.2 <C> int

Block

[0]
Controls moving column, it is useful especially if there are some cells spanned to or from other columns.
If set to > 0, it is the block the column belongs to. Create blocks that contain the spanned cells. The blocks must be continuous.
The columns can be moved only inside its block and any other column cannot be moved into the block from outside.
The first (left) column in the block cannot be moved within the block and also must stay the first.
The whole block can be moved by dragging the first left column to another location.
It also preserves splitting block of columns to more pages when printing and for column paging.
Since 9.2 it was renamed from Group.

Vertical spanning among rows

IE8 strict mode has problems with rowSpan HTML attribute, so when using RowSpan switch IE8 to quirks mode (no !DOCTYPE) or to IE7 compatibility mode.
The functions problematic in IE8 strict mode and RowSpan: column with both RowSpan and Span - hide, show and move. Row with RowSpan - add, delete, move. Sort, filter and group are without problems.

In tree are all rows' children spanned according to its parent row. The last row's children are or are not included in range, according to the RowSpan is integer or not.
Cells are never spanned vertically among pages, the created page is always as high as to accommodate all spanned rows. In server paging you must ensure it by yourself.
Spanned rows are sorted and grouped together, their position within spanned range is always preserved.
It is possible to drag or add row into spanned range, the dropped row will get the span setting from the range.
It is possible to drag row outside spanned range, the dropped row will loose its row span and the cells become displayed.
It is possible to delete row from range, when deleted the first row (with RowSpan set), the range is split and the cells become visible, the row deleting will happen after uploading to server.
It is possible to drag whole spanned range by dragging the first row in range, when moved to another spanned range, the original spanned range is split.
It is possible to drag row inside the spanned range, only the first row (with RowSpan set) will stay always the first row in the range.
The row spanning was updated in version 7.0, in 6.x version it had various limitations and could broke layout in various cases.
new 6.0 upd 16.2 <C> int

Spanned

[0]
If the column contains any vertically spanned cells among rows (marked with RowSpan attribute).
Every column that contains some spanned cells among rows must have set Spanned="1", otherwise the cell RowSpan attribute will be ignored.
Since 16.2 if set to 2 it prefers during row span initialization the later RowSpan before the sooner RowSpan - it cuts the RowSpan when some spanned cell has set the RowSpan attribute.
new 6.0 upd 7.0 <I cell> int

RowSpan

[0]
For vertically spanned cell among rows, how many cells it covers, at least one. Including hidden rows.
In tree it is a count of rows on the same level as this row. All their children are spanned automatically.
(New in 7.0) The last row's children are spanned within range when added 0.5 to the RowSpan, e.g. RowSpan='3.5' means span for three row and also the last row's children. The 0.5 cannot be used in ReversedTree.
The column with spanned cell must have set Spanned='1', otherwise the attribute is ignored.

Dynamic spanning

The cells in grid can be spanned dynamically by a user. He can select the cells by mouse dragging or shift/ctrl + click and click to Join button on toolbar. The spanned cells can be similarly split by selecting them and clicking to Split button on toolbar. The actions for spanning / splitting can be attached also to any other event like right/middle button click or popup menu item action.
The changes can be also uploaded to server, see Upload_Type="Span" and Upload_Flags="Spanned"
Only variable rows can be dynamically spanned.
new 7.0 upd 12.0 <Cfg> int

DynamicSpan

[0]
Set it to 1 to show icons for spanning on Toolbar and also prepare grid for spanning when no cell in grid is spanned on start.
When set to 1, it also saves changes in span and column moving to Undo.
Since 12.0 if set to 2, it also sets Spanned = 1 to all default rows and columns.
To permit selecting cells or cell ranges set <Cfg SelectingCells='1'/>.
By default cells can be selected by Ctrl + mouse drag. To swap the action with dragging rows, set <Actions OnDragCell="SelectCells" OnCtrlDragCell="DragRow"/>.
To clear selection on click set <Actions OnClickCell="ClearSelection,FocusEdit" OnClickOutside="ClearSelection,Blur"/>.
new 15.0 <Actions>

Span ...FSRCW

Attached to OnClickButtonJoin event
Spans focused or selected cells into one cell spanned horizontally and / or vertically.
If the selected cells are not in one rectangle, it creates more rectangles from the selection and spans one by one.
If there were already some cells spanned and interfered with the ranges, they are cut and split.
TreeGrid cannot span whole row or whole column, if the action is called to span whole rows or columns, it spans only already loaded cells in these rows / columns.
new 15.0 <Actions>

Split ...FSARCWO

Attached to OnClickButtonSplit event
Splits all spanned cells in focused or selected range(s) or in actual cell.
new 7.0 deleted 15.0 <Actions>

SpanCells

,

SpanSelected ...F

Not attached to any event
Replaced by action Span.
new 7.0 deleted 15.0 <Actions>

SplitCell

,

SplitCells

,

SplitSelected ...F

Not attached to any event
Replaced by action Split.
new 7.0 upd 16.2 API method void

SpanRange

(TRow row1, string col1, TRow row2, string col2, bool noshow = 0)
Spans the range into one cell with value from cell [row1,col1].
Since 16.2 if set noshow, it does not display the changes in grid, re-render is required.
The noshow can be set also when spanning more cells individually in the same rows, to do the refresh only in the last span.
The [row1,col1] must be the upper left corner.
new 7.0 API method void

SplitSpanned

(TRow row, string col)
Splits the spanned cell. The row, col can be any cell within the rectangle to split.
new 15.0 <Cfg> int

AutoSpan

[0]
If and how will be cells automatically spanned and split to show their whole content. Bit array.
It is an alternative to Overlay.
1. bit &1 - The cells will be spanned or split vertically after value and its size changed.
2. bit &2 - The cells will be spanned or split horizontally after value and its size changed.
3. bit &4 - The cells will be spanned or split vertically on start. Can be slow!
4. bit &8 - The cells will be spanned or split horizontally on start. Can be slow!
5. bit &16 - If set, the cell will be auto spanned only through empty cells. The cell is not re-spanned if the next cell value is changed.
6. bit &32 - If set, the calculation will use actual row heights instead of default row heights. For bits 1 and 2.
new 15.0 <Actions>

AutoSpan ...FAO

Not attached to any event
Automatically spans the actual or focused cell through next rows and columns to show fully its content without changing the row height and overlaying the column.
new 15.0 <Actions>

AutoRowSpan ...FAO

Not attached to any event
Automatically spans the actual or focused cell through next rows to show fully its content without changing the row height.
new 15.0 <Actions>

AutoColSpan ...FAO

Not attached to any event
Automatically spans the actual or focused cell through next columns to show fully its content without overlaying the column.
new 15.0 API method bool

AutoSpanCell

(TRow row, string col, int type = AutoSpan&3)
Automatically spans the cell through next rows and columns to show fully its content without changing the row height and overlaying the column.
type=1 spans only vertically, type=2 spans only horizontally, type=3 spans in both directions.
Returns true if changed the cell span.