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

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

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

Paging root rows

TreeGrid documentation

TreeGrid can automatically split root rows to pages and display them only on demand - when the page becomes visible due scroll.
The page names and links can be displayed in large vertical pager or in simple horizontal pager row.
For other possibilities of paging see paging tutorial.
See also examples in downloadable trial, for your server side script. For server paging see "Ajax table with server paging and export" example.

This paging type can page only root rows and cannot divide children of root rows to pages. So in tree this paging can become ineffective.
For paging child rows in tree use <Cfg ChildPaging/> and / or <Cfg ChildParts/>, see paging in tree.
The paging in tree is permitted by default - opposite to root paging.
<Cfg> int

Paging

[0]
Method of root paging used.
This paging is done only for root rows, it is the best for plain grids or trees with many root nodes.

0No paging
All rows are in one page, pager cannot be visible. All rows are rendered on start. This means slow start and fast use.
It is good for small grids, up to about 1000 rows in root.

1Show all
Pages are automatically created, but all are rendered on start.
For AllPages = 1 it renders all pages on start, but asynchronously and also pager components can be shown and used.
For AllPages = 0 is the same as 2 - Client paging.
It is good for medium grids, 250 - 1000 rows in root, to let users to easy navigate between parts in grid.
It can be used also to avoid browser "Slow script" message when rendering too many rows without paging.
You can also suppress the rendering message by setting <Lang><Text RenderProgressText=""/></Lang> and render all the pages on background. But it will slow the grid interaction responses.

2Client paging   (auto - fully done by TreeGrid)
Pages are automatically created.
For AllPages = 1 is page rendered only when it is visible in window by scrolling.
For AllPages = 0 is page rendered immediately, but it is visible only one page at a time and after switch to another page, the body is re-rendered.
It is good for large grids up to 10 000 rows. All functions still work offline, include sorting, filtering, grouping, searching and calculations.
The client paging does not require any server side support.

3Server paging   (auto fully done by TreeGrid)
Pages are created by server and TreeGrid downloads only page(s) being displayed.
The server is responsible for sending data for requested page and also for sorting, filtering, grouping, searching and aggregate calculation.
Calculations are still possible offline on client, but must be prepared on server.
It is good for very large grids, with more then 10 000 rows or for grids with special relations or grids need to be online.
The server paging requires a lot of your code on server side. To simplify this task you can use TreeGrid.dll/so.
For more information see server paging. If you are not able to do sorting, filtering or grouping on server and you still want to use these features, you can set OnePage attribute (and AllPages=0) to do them partially in actual page.
Server paging cannot be used with Gantt chart.
<Cfg> bool

AllPages

[1]
Paging display mode
0Shows one page at a time and switches to pages only by pager click or by pressing PageUp / PageDown key.
1Shows all pages in grid at once and renders pages on demand, when they are displayed by scrolling.
<Cfg> int

PageLength

[20]
Average count of rows in page.
For client paging there are all pages created to contain this number of rows (except the last one).
For server paging it determines height of page - it is default value of <B Count> attribute.
Exact count of rows in pages can differ due to adding or deleting rows or in last incomplete page.
Every page must contain at least one row otherwise it is deleted. Exception is when grid does not contain any row, so it contains one empty page.
In TreeGrid server is this parameter used to set count of rows in page.
It is also possible to change it dynamically by API, but after change must be called grid.CreatePages(); grid.Render();
<Cfg> int

PageTime

[200]
How long (in ms) must be page visible (by scroll) before it loads data or renders (for AllPages=1).
new 6.0 <Cfg> int

MaxPages

[20]
Maximum rendered root pages in grid, only for AllPages = '1' and Paging >= 2.
When grid contains more rendered pages, the pages longer not accessed are cleared (only in HTML, pages data are not affected).
Used to not slow down the browser when too many HTML tags are displayed.
For large pages you can lower this value.
The actually displayed pages are never cleared.
Set it to 0 to disable clearing pages.
new 9.0 <Cfg> int

RemoveUnusedPages

[2]
If set to 0, it never removes unused root pages, child pages/parts and column pages.
If set to 2, it removes unused pages due MaxPages, MaxChildParts and MaxColPages.
If set to 3, it removes also data of unused root pages or child pages.
It removes only page or child page that does not contain changed rows.
new 12.0 <Cfg> int

RemoveUnusedFixed

[3]
If the fixed left and right column sections will be removed when removing unused row pages by MaxPages or MaxChildParts.
0 - none, 1 - left, 2 - right, 3 - both
new 9.3 <Cfg> int

RemoveChanged

[0]
How will behave changed rows on RemoveCollapsed or RemoveUnused.
0 - Don't remove changed rows and selected rows. If there is any such row, the removing is not done.
1 - Don't remove changed rows. If there is any such row, the removing is not done.
2 - Remove changed rows.
3 - Save changes and remove rows immediately.
4 - Save changes and wait for the server success response before removing rows.
new 6.7 <Cfg> int

PageWindowAdd

[0]
Increase this value to load and render the pages sooner than they are shown.
How many pixels before or after page can remain, before it is rendered or loaded.
By default (for 0) is page rendered after it is at least partially shown.
Remember, when scrolling grid, the pages are rendered after the scrolling finishes, regardless on this value.

Auto adding pages

Automatic adding new root pages on scroll

new 12.0 <Cfg> bool

AutoPages

[0]
If set, adds new root pages to the end of grid when it is scrolled down to the end of grid.
To use it, must be set also Paging to 1, 2 or 3 and AllPages to 1.
Printed, exported and uploaded are rows to last not empty row, see GetLastDataRow API method.
new 12.0 <Cfg> int

RemoveAutoPages

[0]
If the empty added pages will be automatically removed when the grid is scrolled up.
0 - never
1 - yes, the removed pages will be placed to RemovedPages and will be recreated from this stack. Useful to preserve the ids of the new rows and for Undo.
2 - yes, the removed pages will be thrown out. Useful for server paging or to remove all set attributes from the removed pages.
The page is removed only if all rows on the page and on all next pages are empty (values and EditAttrs).
new 12.0 API event void

OnPageAdded

(TGrid grid, TRow page)
Called after new page is added due AutoPages.
new 12.0 API event bool

OnRemoveAutoPage

(TGrid grid, TRow page)
Called before removing given page due RemoveAutoPages.
Return true to not remove this page and any of the previous pages.
new 12.0 API variable TRow

RemovedPages

The removed pages due RemoveAutoPages.
Can be set to null, to permanently remove these pages.
Their rows can be iterated by such loop: for(var r=grid.GetFirst(grid.RemovedPages);r;r=grid.GetNext(r)){ ... }

API

API method int

GetPageNum

(TRow page)
Returns position of page (page index) inside body, from 0.
API method TRow

GetPage

(int num)
Returns root page inside that row is placed.
API method TRow

GetRowPage

(TRow row)
Returns root page inside that row is placed.
API method int

GetPagePos

(TRow row)
Returns row's position in its root page. It counts only visible rows.
In tree it counts all rows above the row inside the page.
API method TRow

PagePosToRow

(TRow page, int pos)
Returns row on given position on page. It counts only visible rows. It is only for loaded pages (State>2).
In tree it counts all visible expanded rows within the tree.
API method TRow

GetFPage

( )
Returns actual root page, if only one page is displayed at a time (if set <Cfg AllPages='0'/>
API method void

GoToPage

(TRow page)
Scrolls or moves to given page. To get page object by index use GetPage method.
Moves actual focus to appropriate row in the page (e.g. if the third row on the actual page was focused, the third row on the new page become focused).
API event bool

OnGoToPage

(TGrid grid, TRow page, int pagepos)
Called when grid displays another page. Return true to cancel change.
page is page (<B> tag) which will be changed to, pagepos is this page position inside body, from 0.
Called from GoToPage method.
It is called when user clicks page link on pager.
It is not called when a user scrolls or focuses to new page.
API method void

GoToNextPage

( )
Scrolls or moves to the next page. Moves actual focus to appropriate row in the page.
If you call this function from external button onclick, you should cancel the event by adding CancelEvent (event) to your handler or use StaticCursor='1' to preserve grid from loosing focus.
API method void

GoToPrevPage

( )
Scrolls or moves to previous page. Moves actual focus to appropriate row in the page.
If you call this function from external button onclick, you should cancel the event by adding CancelEvent (event) to your handler or use StaticCursor='1' to preserve grid from loosing focus.
API method void

ShowPages

( )
Starts loading and rendering displayed pages. Asynchronous.
Call this method if pages are not rendered automatically when you do some unusual changes in grid.
API method void

CreatePages

( )
Re-creates pages. After call must be called Render to re-render the grid.
Useful when PageLength was changed by API.
API method TRow

AddPage

(string name, string xml, int count)
Adds new page to the end of pages.
name is page name in pager, can contain HTML code.
xml is xml content for page, it can contain only rows like "<I A='10'/><I A='20'/>".
For server paging (Paging=3) xml can be null and data for page will be loaded from server, in this case count is supposed count of rows on page.
API event void

OnRenderPageStart

(TGrid grid, TRow row)
Called before rendering of the root page or child page started rendering.
When used child paging (<Cfg ChildPaging>), this event is fired before start of rendering children when a parent row is being expanded.
API event void

OnRenderPageFinish

(TGrid grid, TRow row)
Called after the root page or child page is fully rendered and ready.
When used child paging (<Cfg ChildPaging>), this event is fired after children are rendered when a parent row is being expanded.
API method void

RefreshPage

(TRow page, bool always = 0)
Re-renders page or row's children. For always = 1 re-renders the page also if it is not visible due scroll or expand state.
new 11.0 API method bool

RemovePage

(TRow page)
Removes the root page. All rows are physically removed according to RemoveChanged setting.
Returns false if it fails - it cannot remove page with focused cell or due RemoveChanged.
new 9.0 API event void

OnRemovePage

(TGrid grid, TRow page)
Called after removing data from page or child page, when set RemoveUnusedPages = 3.
new 9.3 API event int

OnRemoveChanged

(TGrid grid, TRow page)
Called if removing page containing some changed (or selected row for RemoveChanged==0)
For RemoveChanged==2 is called always.
Return new value for RemoveChanged to use - 1, 2, 3, 4
<Actions>

Repaint

Not attached to any event
Refreshes pages, when too many pages are displayed, the grid can slow down.
new 7.0 <Actions>

RenderPages

Attached to event OnClickButtonRepaint
Switches for Paging, ColPaging and ChildParts between value 1 and 2.
If any of the attribute is 2, it switches to 1 and renders all not yet rendered pages.
If all attributes are 1, it switches to 2 and clears all unused pages according to the MaxPages, MaxColPages and MaxChildParts settings.