Column deleting
TreeGrid documentation
new 12.0 <Cfg> bool
ColDeleting
[0]
If it is possible to delete columns from grid.
By default it is disabled!
<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.
new 12.0 <C> bool
CanDelete
[1/0]
If the column can be deleted.
It is 1 for all columns except Panel, Index and Gantt.
new 12.0 <C> bool
Deleted
[0]
It is set to
1 when the column has been deleted.
The column is hidden if
ShowDeleted='0' or visible and colored red (by default setting in Grid.css) when
ShowDeleted='1'.
If the column is shown, it can be undeleted.
The deleted column is ignored in summary calculations. The deleted column cannot be moved.
After uploading changes to server or calling
AcceptChanges() the deleted column is physically removed from grid.
new 12.0 API method bool
OnCanColDelete
(TGrid grid, string col, int type, string[] cols)
Called before column is deleted or undeleted.
Called to find out if and how can the column be deleted or undeleted.
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 column and 3 for not deleted column has no effect.
If fires when deleting selected rows,
type =
1 has no meaning.
cols are set if called on deleting selected columns and contains all the selected columns to delete or undelete.
For every of these columns is called the OnCanColDelete.
new 12.0 API method void
OnColDelete
(TGrid grid, string col)
Called when the column is deleted.
new 12.0 API method void
OnColUndelete
(TGrid grid, string col)
Called when the column is undeleted.
new 12.0 API method bool
DeleteCol
(string col, int type, bool test)
Deletes / undeletes column from grid. Displays changes. Prepares deleting and calls DeleteColT ( ).
type =
1 – delete + confirm dialog,
2 – delete,
3 – undelete.
Only marks the column as deleted.
Returns true if the deletion was done.
If set
test =
1, does not delete column, only tests if it is possible, but does not show confirm message, takes it as confirmed.
new 12.0 API method bool
DeleteColT
(string col, int type)
Deletes / undeletes column from grid. Displays changes.
type =
2 – delete,
3 – undelete.
new 12.0 API method void
RemoveCol
(string col)
Physically removes the column from grid and data.
The column is really deleted, not just marked!
For marking column as
Deleted use
DeleteCol() instead.
Remember, removed column cannot be used in any API function,
especially take care in loops, you cannot use GetNextCol / GetPrevCol functions with removed column.
new 12.0 API method int
DeleteCols
(string[] cols, int del = 1)
Deletes (
del =
1), or undeletes (
del =
0) or removes (
del =
2) all given columns in grid.
Returns final count of affected columns.
Deletes / undeletes column from grid. Displays changes.
type =
2 – delete,
3 – undelete.
new 12.0 <Actions>
DeleteCol ...F
Attached to OnClickPanelColDelete event
Deletes actual or focused column, the column is marked as
Deleted.
new 12.0 <Actions>
UndeleteCol ...F
Attached to OnClickPanelColDelete event
Undeletes actual or focused column.
new 12.0 <Actions>
RemoveCol ...F
Not attached to any event
Physically removes actual or focused column.
new 12.0 <Actions>
DeleteCols ...F
Not attached to any event
Deletes all focused columns, the columns are marked as
Deleted.
Without ...F fails if the actual column is not focused.
new 12.0 <Actions>
UndeleteCols ...F
Not attached to any event
Undeletes all focused columns.
Without ...F fails if the actual column is not focused.
new 12.0 <Actions>
RemoveCols ...F
Not attached to any event
Physically removes all focused columns.
Without ...F fails if the actual column is not focused.
new 12.0 <Actions>
DeleteSelectedCols ...F
Not attached to any event
Deletes all selected columns, the columns are marked as
Deleted.
Without ...F fails if the actual column is not selected.
new 12.0 <Actions>
UndeleteSelectedCols ...F
Not attached to any event
Undeletes all selected columns.
Without ...F fails if the actual column is not selected.
new 12.0 <Actions>
RemoveSelectedCols ...F
Not attached to any event
Physically removes all selected columns.
Without ...F fails if the actual column is not selected.