Row and column identity
FastGrid documentation
Row / column id
Unique identification of the row or column.
The row ids must be unique among all rows. The column ids must be unique among all columns.
But it is recommended to have unique ids among all rows, columns, toolbars and toolbar cells.
If not set, the row id is automatically generated according to the
RowId,
RowIdChars,
RowIdPrefix and column id by
ColId,
ColIdChars,
ColIdPrefix.
If set
RowIndex /
ColIndex &
128, the
id is generated as row / column
index.
If the item is defined by number or string and not by object, it is set as
D attribute if it is existing default object and also as
id attribute, for example
Head:[ "Header" ] is the same as
Head:[ { D:"Header", id:"Header" } ]
Prefix added before auto generated row ids.
List of characters used for generating row ids, used in the order according to the
RowId (0 means empty id, 1 means first character, 2 second, etc.).
If not set (by default), the ids are numbers, directly the
RowId.
Actual number for auto generating row ids
id.
It is incremented for every auto generated row id.
Controls auto generating ids for newly added or copied rows and for rows moved from another grid.
1. bit &
1 - if set, assigns always the lowest id (reuses ids from removed rows) to newly added rows.
2. bit &
2 - if set, preserves ids of rows moved from another grid, except if the id already exists.
3. bit &
4 - if set, preserves ids of rows copied from another grid, except if the id already exists.
4. bit &
8 - if set, preserves ids of rows moved from another grid, also if the id already exists, but the row is deleted.
Grid variable Row[id]
Rows
All rows (not toolbars) in grid by their
id. Or if set
RowIndex&128, also by their index.
Prefix added before auto generated column ids.
Cfg string
ColIdChars
["ABCDEFGHIJKLMNOPQRSTUVWXYZ"] GetCfgAttr
List of characters used for generating column ids, used in the order according to the
ColId (0 means empty id, 1 means first character, 2 second, etc.).
If not set, the ids are numbers, directly the
ColId.
By default the ids are generated from upper case letters,
ColId = 0 = "", 1 = "A", 2 = "B", ... 26 = "Z", 27 = "AA", 28 = "AB", ... 52 = "AZ", 53 = "BA", ... 702 = "ZZ", 703 = "AAA", ...
Actual number for auto generating column ids
id.
It is incremented for every auto generated column id.
Controls auto generating ids for newly added or copied columns and for columns moved from another grid.
1. bit &
1 - if set, assigns always the lowest id (reuses ids from removed columns) to newly added columns.
2. bit &
2 - if set, preserves ids of columns moved from another grid, except if the id already exists.
3. bit &
4 - if set, preserves ids of columns copied from another grid, except if the id already exists.
4. bit &
8 - if set, preserves ids of columns moved from another grid, also if the id already exists, but the column is deleted.
Grid variable Col[id]
Cols
All columns in grid by their
id. Or if set
ColIndex&128, also by their index.
If set, the row or column shows the columm or row indexes / ids instead of the cell values.
0 - the row / column shows cell values normally.
1 - the row shows the column indexes or the column shows the row indexes.
2 - the row shows the column ids or the column shows the row ids.
By default it is
1 in Index rows / columns,
2 - Header rows / columns and
0 in all other rows and columns.
It is not read from Row.D / Col.D!.
If set, the row / column is excluded from generating index and is displayed as empty in rows / columns with
Index =
1
If set to
2 it also ignores the
Index when reading cell value.
By default it is
1 for all special rows and columns (Header, Index, Filter, Panel),
2 for Empty rows and columns
and
0 for all normal data rows and columns.
API event string / int
OnGenerateId
(Grid grid, object item, string / int id, int type)
Called when generating id for any row, column, toolbar or toolbar cell in grid.
It is
not called if the item has set its unique id.
type is
item kind:
0 - row,
1 - column,
2 - group row,
3 - goup column,
4 - toolbar,
5 - toolbar cell.
Grid method bool
SetRowId
(Row row, string / int id)
Changes the row
id and updates references to the row. It does not mark the change, the row will be uploaded under the new id and the old id is forgot.
Returns true for success or false if some row with the
id already exists in the grid.
Row / column index
If and how will be generated row indexes.
1.bit &
1 - generates index for normal rows.
2.bit &
2 - generates index also for collapsed rows.
3.bit &
4 - generates index also for manually hidden rows.
4.bit &
8 - generates index also for filtered rows.
5.bit &
16 - generates index also for deleted rows.
6.bit &
32 - resets index on part - every part starts by the
RowIndexStart.
If set, edit formulas use id instead of index.
7.bit &
64 - resets index on children - every children start by the
RowIndexStart.
If set, edit formulas use id instead of index.
First number for generating row index.
List of characters used for generating row index, used in the order according to the index number (0 means empty id, 1 means first character, 2 second, etc.).
If not set (by default), the indexes are numbers, directly from the
RowIndexStart.
To generate row number index with leading zeros, e.g. for 4 digits like 0001, 0002, ..., set RowIndexStart = 1112, RowIndexChars = "0123456789".
If and how will be generated column indexes.
1.bit &
1 - generates index for normal columns.
2.bit &
2 - generates index also for collapsed columns.
3.bit &
4 - generates index also for manually hidden columns.
4.bit &
8 - generates index also for filtered columns.
5.bit &
16 - generates index also for deleted columns.
6.bit &
32 - resets index on part - every part starts by the
RowIndexStart.
7.bit &
64 - resets index on children - every children start by the
RowIndexStart.
First number for generating column index.
Cfg string
ColIndexChars
["ABCDEFGHIJKLMNOPQRSTUVWXYZ"] GetCfgAttr
List of characters used for generating column index, used in the order according to the index number (0 means empty id, 1 means first character, 2 second, etc.).
If not set, the indexes are numbers, directly from the
ColIndexStart.
By default the indexes are generated from upper case letters, index number = 0 = "", 1 = "A", 2 = "B", ... 26 = "Z", 27 = "AA", 28 = "AB", ... 52 = "AZ", 53 = "BA", ... 702 = "ZZ", 703 = "AAA", ...
If set, the row or column shows the columm or row indexes / ids instead of the cell values.
0 - the row / column shows cell values normally.
1 - the row shows the column indexes or the column shows the row indexes.
2 - the row shows the column ids or the column shows the row ids.
By default it is
1 in Index rows / columns,
2 - Header rows / columns and
0 in all other rows and columns.
If set, the row / column is excluded from generating index and is displayed as empty in rows / columns with
Index =
1
If set to
2 it also ignores the
Index when reading cell value.
By default it is
1 for all special rows and columns (Header, Index, Filter, Panel),
2 for Empty rows and columns
and
0 for all normal data rows and columns.
Grid method string
GetIndex
(Row / Col item, int plus = 0)
Returns index of the row or column according to RowIndex... / ColIndex... settings. If the
item has no index, returns empty string.
If set
plus, adds it to the row position before converting to the index.
Grid method Row / Col
GetByIndex
(string index, string part = null, int repaint = 0)
Returns row or column according to its generated
index.
If the row / column with given
index does not exist and the
part is set to some row or column part id, it adds required amount of rows / column to this part to create the row / column with the
index.
repaint can be set to paint changes if the row / column is added:
1 calls
Paint,
2 - calls
Paint and scrolls part to the item,
3 - calls
Paint and scrolls and focuses the item.
Grid method int / string
GetRowIndex
(int / string index, bool type = 0)
For
type =
0 converts row index to the row position.
For
type =
1 converts row position to the row index.
Grid method int / string
GetColIndex
(int / string index, bool type = 0)
For
type =
0 converts column index to the row position.
For
type =
1 converts column position to the row index.
Row / column name
Row / column name that is shown as in menus, messages and toolbars.
If not set, value from column / row with
Names or row / column index or row / column id is used.
If set the row values are used as
Name for the columns in the row set.
Or the column values are used as
Name for the rows in the column part set.
Grid method string
GetName
(Row / Col item)
Returns name of the row or column
item according to the
Name /
Names.
API event string
OnGetName
(Grid grid, Row / Col / Toolbar item, string name)
Called to get row / column / toolbar
Name.
name is actually chosen name for the row.