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) Upgrading from 9.3 to 10.0 Upgrading from 5.9 to 6.0

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 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 and type Cell value Reading / writing attributes by API Cell HTML 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 Defaults list Suggest list (auto complete) 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) Mathematical functions 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 Special cell style attributes Cell CSS class Cell background color Dynamic cell border Cell HTML style Row color alteration Cell mouse cursor

Cell types
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 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 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 Basic settings Communication with server Export API Client export Server export

Copy & paste rows via clipboard

Copy & paste permissions Copying to clipboard Pasting from clipboard

Master - detail grids

Introduction External master - detail grids Nested master - detail grids Synchronizing grids Other attributes for master - detail

Pivot tables

Pivot attributes & API Pivot formulas

External objects (like Adobe Flash) Undo & Redo
Gantt and bar chart
Gantt objects

Gantt objects list Display settings Edit settings

Main bar

Definition of main bar and plans Main bar as Task Edit settings Main bar content and side html Tip on mouse hover Vertical position and height Style specific attributes API to manipulate Main bars Actions Side text (deprecated) Real Flow (deprecated)

Run bar

GanttRun Definition Extended definition Run bar as Task Edit settings Save format Selecting Run boxes Run box content and side html Tip on mouse hover Box identification Vertical position and height Style specific attributes Overlaid (Error) boxes 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

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 Language & regional setup (Text.xml) Useful API function Help file

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 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

Column basics

TreeGrid documentation

TreeGrid column is defined by tag <C>, placed in <Cols> or <LeftCols> or <RightCols> section.
The column specifies position, size, visibility settings and restrictions of the grid column.
And also specifies default type, formatting, editability and other cell setting for all cells in the column. The type, formatting and other settings can be overridden for every particular cell by its attributes.
Columns do not contain cell values, the cells are defined in rows.
Column captions are defined in Header row(s).

TreeGrid column can be fixed (frozen) or variable (scrollable).

Fixed (frozen) column can be positioned on the left or on the right grid side. The fixed column cannot be scrolled outside view.
To set fixed column, place the <C> tag to <LeftCols> or <RightCols> section.
If all fixed columns together are too wide, wider then main tag width, TreeGrid can neither scroll them nor display them, so it cannot display its content and displays only message "Too small extents".

Variable (scrollable) column is positioned between left and right fixed section.
To set variable column, place the <C> tag to <Cols> section.
If all variable columns are wider then the variable section, they are horizontally scrolled.
A user can move the column between section (freeze / unfreeze) by mouse dragging if the column have set CanMove='2' (it is set by default).

To predefine some attributes for more columns define <D> tag with these attributes and place it to <DefCols> section. And point the specified columns to it by their Def attribute.
To predefine some attributes for all columns, set them to <D Name='C'> tag. This tag is placed also to <DefCols> section. By default it is defined in Defaults.xml with default settings for all grids.
For example if you define <Def><D Name='C' Type='Int'/></Def> all columns will have Type Int.

There is one special column, the row's left panel with buttons for deleting and selecting row. It is positioned as the first left fixed column and can be visible or hidden. It can be set by <Panel> attribute placed in root <Grid> tag.

In tree there is one main column where is displayed tree with icons for expanding and collapsing. In grid there can be only one main column, its name is set by <Cfg MainCol> attribute.

Column caption and other header setting are set by <Header> tag placed in root <Grid> tag.
<C> string

Name

Column name. Required. Every column must have set this attribute.
The Name identifies column and row's cells. Under this name are row's cells in this column set and accessed.
All column names must be unique among all column names inside one grid.
Under this name grid saves column configuration to the cookies.
In JavaScript API, cell is accessed by column name.
Column names are used also in formulas.
! Attention !
Column names are case sensitive.
Column names can contain only letters (a-z, A-Z), underscore '_' and digits (0-9), but cannot start with digit and should not start with underscore.
Column names must not interfere with row's attribute names, like Def, Kind or Deleted !
The best way is to name columns as letter 'A', 'B' or 'a', 'b'. There is no interference and data length is short.
For grids with many columns and saved configuration to cookies the column names should be less then 4 characters long, to shorten cookie length.
<Header cell> string

value

Column caption is not set in <C> tag, but in <Header> row cell.
The <Header> row is fixed (Head or Foot) row with column captions and sorting icons. It cannot be editable.
It has the same row and cell attributes like normal grid row, but it have usually different look (according to style definition).
You can especially use Header style attribute like Align, Wrap or NoEscape to format the column captions.
You can have more Header rows in grid. You can also span the Header cells to show merged column captions.
new 12.0 <I> bool

ShowColNames

[0/1]
If the fixed row cells show column names. By default it is set to 1 for Header rows and 0 for all others.
<C> string

MenuName

Html string displayed in Columns menu for this column. If not set, the column caption is displayed.
<C> string []

SearchNames

Comma separated strings as possible names of the column. Used for search and editable formulas.
new 6.0 upd 10.0 <C> <D> string

Def

["C"]
The name of default column <D> used for this column or default column. From this default the column inherits all its not set attribute values.
Remember, opposite to default rows all the columns read their values from default columns on start! So the default columns are not accessible by API.
Default value for Gantt type column is "Gantt", for other columns "C".
Since 10.0. It can contain more default names, comma separated. Remember the difference, <I Def/> can contain only one default.
upd 6.0 <D> string

Name

Name of default column. Required. This name is referenced by column attribute Def.
The <D> tag as default column can be placed only to <DefCols> section.
Any custom name can be used for default row.
There is one predefined name "C" as default column for all columns in grid.

Column index

Shows row with column positions, usually as number from 1 or alphabetical name.
It does not identify column uniquely, for column identification use column Name instead.
Used also for editable formulas. See also row index.
new 12.0 <Cfg> string

ColIndex

An id of the row that will show the column positions in grid.
If the row does not exist, it is created as the last row in Head section as <Header Def="Header" id=ColIndex Visible="1" Kind="Header"/>.
It is possible to set SearchNames to the same value as ColIndex to use the col index as column name.
I does not work in server paging.
It iterates all the ColIndex cells after any column order change and resets the value, so it can be slow in very large grids.
new 12.0 <Cfg> int

ColIndexType

[0]
Bit array of flags for the ColIndex.
1.bit (&1)Count also deleted columns
2.bit (&2)Count also filtered columns not implemented yet
3.bit (&4)Count also manually hidden columns
4.bit (&8)Count also left section columns
5.bit (&16)Count also right section columns
6.bit (&32)Count also Panel and Gantt type columns
new 12.0 <Cfg> int

ColIndexStart

[1]
The index is created from this number. Useful to have all indexes the same length (e.g. starting from 1000).
new 12.0 <Cfg> string

ColIndexChars

[]
Characters to build the index. By default the index is a number. Setting the ColIndexChars="ABCDEFGHIJKLMNOPQRSTUVWXYZ" use alphabetical indexes.
new 12.0 <Cfg> int

AutoCols

[0]
If set, automatically generates given number of columns. Used only when ColIndex is set.
The columns are generated as last columns in middle section.
The column gets its Name as its generated index. If the index is a number, the Name gets "C" prefix, like C256. The column gets its Def = "Auto".
See also AutoColPages to add new columns on scroll right.
new 12.0 <C> bool

NoIndex

[0]
If set to 1, the column will not be counted by ColIndex.
new 12.0 TCol variable int

HasIndex

[0]
Column position from 1 or 0 for column without index. On grid loading it is available in OnReady and later. It is not affected by ColIndexStart / ColIndexChars. Accessible as grid.Cols[col].HasIndex.
new 12.0 API method string

GetColByIndex

(type index, bool type = 0)
Returns column name according to its index. On grid loading it is available in OnReady and later.
For type = 0 The index is number from 1 as for column (HasIndex).
For type = 1 The index is number or string according to the displayed column index in ColIndex row.
new 12.0 API method type

GetColIndex

(string col, bool type = 0, type default = null)
Returns column index according to its name. On grid loading it is available in OnReady and later.
For type = 0 Returns number from 1 as the column (HasIndex).
For type = 1 Returns number or string as the displayed column index in ColIndex row.
If the column has not index, returns default.
new 12.0 API event bool

OnColIndex

(TGrid grid, string[] values)
Called on recalculate the ColIndex column. values contains the changed indexes that will be assigned after the event finishes. It is named array as new value by column name. The indexes are always from 1, the index to delete is set as "".
You can modify the values, but you cannot add or delete the items from the array.
Or you can assign your own index to the ColIndex column and true to not process the values, it is not possible if the index is used for calculated formula.