property Options: TColumnOptions
Description
Additional settings for the column.
The set has the following values.
Value |
Description |
coAutoSize |
Not used. For automatic column widths, use the BestFitColumns method. |
coCanClick |
Determines whether the header of a given column can be clicked to sort. |
coCanInput |
Makes sense if the TableGrid.Options property has the value goInput. Allows you to enter a value. |
coCanSort |
Determines whether sorting is executed when you click on the header of a given column. |
coDisableMoving |
Disables drag-and-drop of columns. |
coEditing |
Specifies the ability to edit the text in the rows of a given column. |
coEditorAutoSelect |
Determines whether text is automatically selected when the input cursor is set in a cell of a given column. |
coFixedSize |
Disables the resizing of this column. |
coShowTextFitHint |
Determines whether a hint will be shown if the contents of the cell do not fit. |
Example
// As a rule, it is necessary to change column settings in the OnChange event
procedure Form1_TreeView1_OnChange (Sender: TObject);
begin
Form1.TreeView1.Columns[0].Options := Form1.TreeView1.Columns[0].Options - coCanSort; // disables sorting for the first column
Form1.TreeView1.Columns[1].Options := Form1.TreeView1.Columns[1].Options + coFixedSize; // Disables the ability to resize the second column
end;