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

Row deleting

TreeGrid documentation

When a user deletes row, the row is not physically removed. The deleted row is marked as Deleted and is hidden or colored red depending on ShowDeleted.
The deleted row can be still undeleted, by a user if it is visible or by API.
After the changes are uploaded to server and server accepts the changes, the deleted row is physically removed from grid and its data.
<Cfg> bool

Deleting

[1]
If rows can be deleted from grid.
If set to 0, it disables Panel Delete button, the deleting actions and DeleteRow method. The DeleteRowT and RemoveRow are still working.
<Cfg> bool

ShowDeleted

[1]   Saved to cookies
If deleted rows and columns are visible and colored.
If set to 1, deleted rows and columns are still visible and can be undeleted. The deleted rows are colored in red, it can be changed in Grid.css.
If set to 0, deleted rows and columns are hidden and cannot be undeleted by a user.
Setting to 1 when AutoUpdate is true has no effect - the rows are immediately deleted.
new 12.0 <Cfg> int

DeleteMessage

[1]
If the confirmation message for deleting row, selected rows, column and selected columns will be shown.
0 - never, 1 - only if ShowDeleted is on, 2 always.
<I> bool

CanDelete

[1/0]
If the row can be deleted.
By default variable rows can be deleted and fixed rows cannot. Deleting fixed rows is not good idea, fixed rows cannot be added.
upd 12.0 <Header> bool

CanDelete

[1]
Deprecated since 12.0. Use Panel Buttons or Panel value instead to define the panel buttons for header row.
If the Panel DeleteAll button is enabled. Header row itself can never be deleted.
<I> bool

Deleted

[0]   Uploaded to server, supports Undo
It is set to 1 when the row has been deleted.
The row is hidden if ShowDeleted='0' or visible and colored red (by default setting in Grid.css) when ShowDeleted='1'.
If the row is shown, it can be undeleted. Child row of deleted parent cannot be undeleted.
When user deletes row, all its children are automatically deleted to. When user undeletes the parent, all its children are undeleted too, except they were deleted directly.
In API, deleted children due its parent deletion has Deleted='2'.
The deleted row is ignored in summary calculations. The deleted row cannot be moved and does not accept children by dragging or adding.
After uploading changes to server or calling AcceptChanges the deleted row is physically removed from grid.
<C> bool

Delete

[1]
If the default Panel button Delete is visible. This button is hidden also if <Cfg Deleting="0"/>. This button is inactive when the row has CanDelete='0'.
Click to this button deletes row or undeletes deleted row.
Used only if the Panel Buttons and the cell value are not set.
API event void

OnRowDelete

(TGrid grid, TRow row, int type)
Called before the row is deleted. Called after the row is marked as Deleted, but before it is hidden or colored.
Fires for every row being deleted, even for deleted children of deleted parent. First are deleted children and after them the parent.
type = 1 delete row, 2 delete row because its parent is deleted.
If row is removed by RemoveRow ( ), event is not fired!
API event void

OnRowUndelete

(TGrid grid, TRow row)
Called before the row is undeleted. Called after the row has cleared its Deleted attribute, but before it is shown or colored.
Fires for every row being undeleted, even for undeleted children of undeleted parent. First are undeleted children and after them the parent.
upd 11.0 API event int

OnCanRowDelete

(TGrid grid, TRow row, int type, TRow[ ] rows)
Called before row is deleted or undeleted. Called to find out if and how can the row be deleted or undeleted. It is not called for its children.
type = 0 - cannot delete, 1 - user must confirm deleting, 2 - delete, 3 - undelete.
Return new type. Or return the type to not change the behavior. Returning 2 for deleted row and 3 for not deleted row has no effect.
If fires when deleting selected rows, type = 1 has no meaning.
(Since 11.0) rows are set if called on deleting selected rows and contain all the selected rows to delete or undelete. For every of these rows is called the OnCanRowDelete.
API event bool

OnDeleteAll

(TGrid grid, int type)
Called before all selected rows are deleted or undeleted. Return true to suppress the action.
type = 0 undelete, 1 delete, 2 remove.
Remember, this event can be called more times, depending on Actions settings for event ClickHeaderDelete.
upd 12.0 API method bool

DeleteRow

(TRow row, int type, bool test = 0)
Deletes / undeletes row from grid. Displays changes. Prepares deleting and calls DeleteRowT ( ).
type = 1 - delete + confirm dialog, 2 - delete, 3 - undelete.
Deletes or undeletes row with its children. Only marks rows as deleted.
Returns true if the deletion was done.
(Since 12.0) If set test = 1, does not delete row, only tests if it is possible, but does not show confirm message, takes it as confirmed.
API method void

DeleteRowT

(TRow row, int type, bool noshow = false)
Deletes / undeletes row from grid. Displays changes. type = 2 - delete, 3 - undelete.
Deletes or undeletes row with its children.
renamed 6.0 API method void

RemoveRow

(TRow row)
Physically removes the row from grid and data. The row is really deleted, not just marked! For marking row as Deleted use DeleteRow() instead.
Deleted rows are not in output data, thus server cannot see which rows were deleted (only by comparing with original data).
Only variable row can be removed.
Remember, removed row cannot be used in any API function, especially take care in loops, you cannot use GetNext / GetPrev functions with removed row.
new 16.2 API event bool

OnRowRemove

(TGrid grid, TRow row, int type)
Called before the row is physically removed. It is called for every row remove in grid, including temporary rows.
Return true to not remove the row.
new 12.0 API method int

DeleteRows

(TRow[ ] rows, int del = 1)
Deletes (del = 1), or undeletes (del = 0) or removes (del = 2) all given rows in grid.
Returns final count of affected rows.
<Actions>

DeleteRow ...FSARO

Attached to OnDel and OnClickPanelDelete events
Deletes actual or focused row or first selected row, the row is marked as Deleted.
It always deletes only one row, but does not require the row to be the only focused or selected, it is the difference to DeleteRowsO.
<Actions>

UndeleteRow ...FSARO

Attached to OnDel and OnClickPanelDelete events
Undeletes actual or focused row.
It is used only if the deleted rows are visible (<Cfg ShowDeleted='1'/>).
To invert deletion use action setting "DeleteRow OR UndeleteRow".
<Actions>

RemoveRow ...FSARO

Not attached to any event
Physically removes the actual or focused row. The row will no longer exist in grid and cannot be updated to server!
new 12.0 <Actions>

DeleteRows ...FSARCWO

Not attached to any event
Deletes focused or selected or actual rows, the rows are marked as Deleted.
This action can be asynchronous!
new 12.0 <Actions>

UndeleteRows ...FSARCWO

Not attached to any event
Undeletes focused or selected or actual rows.
This action can be asynchronous!
new 12.0 <Actions>

RemoveRows ...FSARCWO

Not attached to any event
Physically removes focused or selected or actual rows. The rows will no longer exist in grid and cannot be updated to server!
This action can be asynchronous!
chg 12.0 <Actions>

DeleteSelected

Attached to OnCtrlDel and OnClickHeaderDelete events
Deletes all selected rows. It fails if there is no selected row or all selected rows are deleted.
It does not delete selected children of selected parents - it is the difference to DeleteRowsS.
This action can be asynchronous!
chg 12.0 <Actions>

UndeleteSelected

Attached to OnCtrlDel and OnClickHeaderDelete events
Undeletes all selected rows. It fails if there is no selected deleted row. Or (Since 12.0) fails if the actual row is not selected and is Kind=Data row.
It is used only if the deleted rows are visible (<Cfg ShowDeleted='1'/>).
To invert deletion use "UndeleteSelected OR DeleteSelected" - remember, here it depends on the order!
This action can be asynchronous!
chg 12.0 <Actions>

RemoveSelected

Not attached to any event
Physically removes all selected rows. The rows will no longer exist in grid and cannot be updated to server!
This action can be asynchronous!