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

Copy & paste via clipboard

TreeGrid documentation

TreeGrid supports copying cells, rows, columns and cell ranges into and from clipboard.
The data are in the same format as standard in spreadsheet programs like MS Excel, so it is possible to copy & paste cells between TreeGrid and MS Excel.

The format of copied & pasted data
Rows are separated by CRLF. Last row is not followed by CRLF. In pasting it accepts also single CR and LF as row separators.
Cells are separated by tabulator. Last cell is not followed by tabulator.
If cell value contains one of characters CR (\r), LF (\n) (&#x0a;), tabulator (\t) (&#x09;) and double quote (") (&#x022;), it encloses the value into double quotes and doubles all double quotes inside.

To copy & paste the Gantt dependencies it must be set CopyPasteInternal or since 13.3 there must be defined and copied column named "id" that contains the row ids or since 13.3 there must be copied column IdNames and IdNames must contain only one column and FullId must be 0.
new 6.0 <C> bool

CanCopyPaste

[1]
If values can be copied from this column to clipboard by Ctrl+C and pasted to this column from clipboard by Ctrl+V.
If the column has CanCopyPaste = 0, it is ignored for both copying and pasting.
new 6.0 <I> int

CanCopyPaste

[1]
If values can be copied from this row to clipboard by Ctrl+C and pasted to this row from clipboard by Ctrl+V.
0Row cannot be copied and pasted.
1Row can be copied and pasted.
2Row can be copied and pasted only with its parent (when set CopyPasteTree).
3Only for fixed row, the row is always copied when all rows are selected and copied or all variable rows are copied. By default it is set for main Header.
new 6.0 upd 13.3 <Cfg> int

CopyPasteTree

[0]
If and how there will be copied children of the rows.
If set to another value than 0, it adds level information to beginning of the first cell, as count of characters U65279.
0Does not copy tree.
1Copies also visible children of expanded parents.
2Copies also visible children of all parents.
3Copies also all children.
4(new 13.3) Does not copy any children, but preserves the tree structure, if copied selected parent with children.
new 6.0 <Cfg> int

CopyPasteInternal

[0]
0Copies cell values to system clipboard and pastes from system clipboard.
1Copies cell values to TreeGrid global private cache, it will be available for all grids on page.
2Copies cell values to TreeGrid local private cache, it will be available only for this grid.
new 6.3 upd 14.0 <Cfg> int

CopyPasteRows

[0]
0Copies cell values, but no other row or cell attributes.
1Copies row ids only. It should be set with CopyPasteInternal>0 to copy the whole rows internally, with all attributes. Copies always all cells.
2(new 14.0) Copies cell valuse and also row ids. If there are more grids on page, copies also grid id as the first cell. When pasting and the source row exists in the grid, makes a copy of this row.
3(new 14.0) Like 2, but never copies the grid id. When pasting, it looks for the row only in the destination grid.
4(new 14.0) Like 3, but never copies the row id. It stores the last copy and when pasting, it looks for the last copied row.
new 13.3 <Cfg> int

CopyPasteHidden

[0]
1.bit &1Copies and pastes also hidden columns. Affects CopyCols (0,3,4) and PasteCols (0,3,4,5).
2.bit &2Copies and pastes also hidden rows. Affects CopyFocused (1) and PasteFocused (1-12)
new 14.0 <Cfg> int

CopyPasteDeleted

[0]
1.bit &1Copies and pastes also deleted columns.
2.bit &2Copies and pastes also deleted rows. If permitted, the pasted new rows are not marked as deleted.
new 12.0 <Cfg> string[]

EditAttrs

[...]
The copy & paste is affected by EditAttrs, for more information see Mass cell changes.

Copying to clipboard

Copying to clipboard can be done only by pressing Ctrl + C or Ctrl + X.
There is no API method to copy to clipboard due browser security restriction.
new 6.0 <Cfg> bool

CopySelected

[1]
0Never copy selected rows.
1Copy all selected rows/cells if any, otherwise copy focused row according to CopyFocused.
new 6.0 upd 16.3 <Cfg> int

CopyFocused

[1]
It is applied only if CopySelected is 0 or if no row in grid is selected.
0Never copy focused row.
1Copy only focused rows.
2Since 16.3 copy only focused rows and rows with CanCopyPaste=3
20Copy all visible variable rows in the same parent as focused row.
30Copy all visible variable rows (if set CopyPasteTree, it affect only root rows, the other are handled by CopyPasteTree), copies also rows with CanCopyPaste=3.
31Copy all variable rows (if set CopyPasteTree, it affect only root rows, the other are handled by CopyPasteTree), copies also rows with CanCopyPaste=3.
new 6.3 <Cfg> bool

CopyEdit

[1]
0Copies displayed text, usable for copying outside TreeGrid.
1Copies value in editable format, usable when copying inside grid.
new 13.3 <Cfg> int

CopyFormulas

[1]
0Copies only the cell value, never the EFormula.
1If cell has the EFormula, it is copied internally to be pasted to TreeGrid. To clipboard there is always copied the cell value.
2If cell has the EFormula, it is copied internally and also to clipboard with '=' prefix. If pasted outside TreeGrid, the formula cell references are not updated!
new 6.0 upd 11.0 <Cfg> int

CopyCols

[1]
Which columns will be used for copy paste.
See also column attribute CanCopyPaste.
0Only focused columns
1All visible columns
2All columns
3(new 11.0) Only focused cell range or all visible columns for selected rows
4(new 11.0) Only focused cell range or all columns for selected rows
new 12.0 upd 15.0 <Cfg> int

ExcludeClear

[0]
How the excluded cells will be cleared.
0 - rows will be deleted.
1 - cells will be cleared.
2 - (new 15.0) cell values will be cleared.
<cell> string

CopyValue

Cell value used for copying to clipboard by Ctr+C / Ctrl+X instead of actual cell value. Useful for HTML type columns.
new 9.3 <Cfg> int

CopyTime

[""]
Copying too many values to clipboard can be too slow and in this case the copying can fail, especially in IE and FF.
If the copying time exceeds this value (in milliseconds), the copying action is canceled and the user must press the Ctrl+C again to finish the copying.
The CopyTime can contain up to four values used for different browsers in this order: [all, IE, FF, Safari/Chrome].
Reasonable value is "200,500,150,1000" or "150".
API event type

OnGetCopyValue

(TGrid grid, TRow row, string col, type val)
Called to get value for copying to clipboard by Ctrl+C.
val is predefined/actual cell value, return val or new value.
new 6.4 API event string

OnGetRowText

(TGrid grid, TRow row, string[ ] col, string txt, bool sel)
Called to get the whole row text, without ending CRLF.
cols are the cells to copy, txt is the default text to copy, sel is set if only selected cells are wanted.
Return new row text to copy to clipboard or txt.
The row text must not contain CRLF string.
new 6.0 <Actions>

Copy

Attached to event OnCtrlC, can be attached only to OnCtrlC or OnCtrlX
Copies data to clipboard.
Action in the CtrlC and CtrlX events must return 0 to permit the default function, use zero after comma like "Copy,0".
new 6.0 <Actions>

Exclude

Attached to event OnCtrlX, can be attached only to OnCtrlC or OnCtrlX
Copies data to clipboard and deletes the copied rows (only if all cells are copied) or if set ExcludeClear clears the copied cells.
Action in the CtrlC and CtrlX events must return 0 to permit the default function, use zero after comma like "Exclude,0".
new 6.0 API event bool

OnCopyStart

(TGrid grid)
Called before the data for copy is generated. Return true to suppress copying.
new 6.0 API event string

OnCopy

(TGrid grid, string txt)
Called after the data for copy is generated. txt is data to be copied to clipboard.
Return null to use the original txt, empty string to suppress copying or new text to copy.

Pasting from clipboard

Pasting from clipboard can be done only by pressing Ctrl + V.
There is no API method to paste from clipboard due browser security restriction.
chg 6.0 <Cfg> bool

Pasting

[1]
If pasting into grid is permitted
new 6.0 <Cfg> bool

PasteSelected

[1]
0Never paste to selected rows.
1Paste to selected rows/cells if any, otherwise paste to focused row according to PasteFocused.
If the pasted range is bigger, the remaining source rows/cells are discarded.
new 6.0 upd 13.3 <Cfg> int

PasteFocused

[8]
It is applied only if PasteSelected is 0 or if no row in grid is selected.
0Never paste to focused row.
1To focused rows only, if the pasted range contains more rows, they are discarded.
2To focused rows and to the next rows below, in the same parent only; if the pasted range contains more rows, they are discarded.
3To focused rows and to the next rows below, including expanded children and parents; if the pasted range contains more rows, they are discarded.
4To focused rows and new next rows are added after the focused rows.
5Inserts one new row in front of the focused rows; if the pasted range contains more rows, they are discarded. The focused row itself is not changed.
6Inserts new rows in front of the focused rows. The focused rows themselves are not changed.
7Inserts one new row in front of the focused rows; if the pasted range contains more rows, they are discarded. The focused row itself is not changed.
If clipboard contains only one value, it pastes it to the actual focused cell.
8Inserts new rows in front of the focused rows. The focused rows themselves are not changed.
If clipboard contains only one value, it pastes it to the actual focused cell.
9(new 11.0) To focused rows and to the next rows below, in the same parent only; if the pasted range contains more rows, they are added to end of the parent.
10(new 11.0) To focused rows and to the next rows below, including expanded children and parents; if the pasted range contains more rows, they are added to end of the grid.
11 (new 12.0) If focused more cells, only to the focused rows, otherwise to focused rows and to the next rows below, in the same parent only; if the pasted range contains more rows, they are added to end of the parent. (= 1 or 9).
Since 13.3 if the focused range contains last row in grid and pasted range contains more rows, they are added to the grid end.
12(new 12.0) If focused more cells, only to the focused rows, otherwise to focused rows and to the next rows below, including expanded children and parents; if the pasted range contains more rows, they are added to end of the grid. (= 1 or 10).
Since 13.3 if the focused range contains last row in grid and pasted range contains more rows, they are added to the grid end.
20Paste to all visible variable rows in the same parent as focused row.
21Replace all siblings of focused row by the pasted rows.
30Paste to all visible variable rows (if set CopyPasteTree, it affect only root rows, the other are handled by CopyPasteTree), pastes also to rows with CanCopyPaste=3.
31Paste to all variable rows (if set CopyPasteTree, it affect only root rows, the other are handled by CopyPasteTree) , pastes also to rows with CanCopyPaste=3.
32Replace all variable rows with the pasted rows.
new 6.0 upd 12.0 <Cfg> int

PasteCols

[4]
Which columns will be used for paste.
See also column attribute CanCopyPaste.
0Paste only to focused columns.
1Paste to all visible columns.
2Paste to all columns.
3Paste to all columns right to the focused cell, including the focused one.
4Paste from actually focused column or, if the data are longer than the rest right to the cursor, pastes from the first column (= 2 or 1 or 3)
5(new 12.0) Paste to only focused columns (like 0), if there are more focused cells. Otherwise like 4.
new 6.0 <Cfg> int

PasteTree

[2]
0Ignore the pasted children.
1Fill the children to the existing children only, use settings from CopyPasteTree.
2Replace the children, if required, delete remaining children or add new children, use settings from CopyPasteTree.
new 14.0 <Cfg> int

PasteErrors

[1]
If the EditErrors messages will be displayed for pasting.
0 - never, 1 - only if pasted to cell range and not to the whole rows, 2 - always.
new 14.0 <Cfg> int

PasteNaN

[0]
If can be pasted value to cell that lead to NaN in cell, e.g. string to number cell.
0 - no, the cell will have original value.
1 - yes, the cell will get NaN value. (default setting prior 14.0)
2 - empty, the cell will get empty or zero value.
new 16.6 <Cfg> bool

PasteNumbers

[0]
If set, TreeGrid tries to convert pasted formatted numbers to numbers instead of strings.
If the conversion is successful, the converted number is displayed unformatted, but can be better used in formulas.
new 6.0 chg 10.0 <cell> int

CanPaste

[1]
If and how can be pasted values written to the cell.
If pasted value cannot be written to the cell, it is discarded (it is not written to the next cell).
0The cell cannot accept pasted value.
1The cell accepts pasted value only if it is editable. To the pasted value are applied EditMask, ResultMask and Size.
Since 10.0 cannot be pasted not existing value to Enum type cell.
It permits pasting any value to not editable cell with Defaults Button or to Select type cell and to cell with SuggestType='Existing'. Use ResultMask to restrict pasting some value here.
2The cell always accepts the pasted value as is.
chg 6.0 API event bool

OnPaste

(TGrid grid, string[ ] cols, string[ ] pastedtext)
Called before cell values are pasted by Ctrl+V from clipboard.
Return true to suppress default action.
pastedtext is array of texts to paste into individual rows. You can modify this array.
cols is array of column names only where will be pasting done. You can modify this array.
chg 6.0 API event void

OnPasteFinish

(TGrid grid)
Called after cell values were pasted from clipboard.
new 6.4 API event bool

OnPasteRow

(TGrid grid, TRow row, string[ ] cols, string[ ] values, bool added)
Called before the values are pasted to the row cells (cols).
The cols array should not be modified - it is used also in next pasted rows.
added is set if the row was added by pasting.
Return true to cancel default behavior.
If true is returned and the row was added by pasting, it is not removed - must be removed by the handler!
new 6.4 API event void

OnPasteRowFinish

(TGrid grid, TRow row, string[ ] cols, string[ ] values, bool added)
Called after the values are pasted to the row cells (cols).
added is set if the row was added by pasting.
new 12.0 API event type

OnPasteValue

(TGrid grid, TRow row, string col, type value, type oldvalue, type[] attrvalues, string[] attrnames, object errors)
Called when pasting value to the cell. oldvalue is actual cell value.
Return new value to paste or value or oldvalue to not change the cell value.
It is possible to modify both the values in attrvalues and in attrnames.
For errors see OnEditErrors API event.
new 6.0 <Actions>

Paste

Attached to event OnCtrlV, can be attached only to OnCtrlV
Pastes data from clipboard.
Action in the CtrlV event must return 0 to permit the default function, use zero after comma like "Paste,0".