TreeGrid v6.0
Column basics
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 captions are not set in <C> tag, but in <Header> row cells.
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.
<C> <D> string Def [“C”] new 6.0 .
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”.
<D> string Name upd 6.0 .
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.