YOUSEFUL / DELPHI / COMPONENTS
TAtlasColumn
The definition of one TAtlasTable column: name, kind, editability and preferred width.
Description
A copy of a column definition, returned by TAtlasTable.Columns[Index]. The fields are set by AddColumn and cannot be changed afterwards; changing a returned copy has no effect on the table.
Members
| Member | Kind | What it does |
|---|---|---|
Name | field | The column name, shown in the grid header and written as the CSV header. |
Kind | field | The TAtlasColumnKind of the column. |
Editable | field | False for a read-only column: SetCell raises and TAtlasGrid opens no editor, but AddRow and ImportCSV can fill it. |
Width | field | Preferred width in pixels at 96 dpi, at least 16. |
Fields
Name field
Name: string;The column name, shown in the grid header and written as the CSV header. Not blank; unique ignoring ASCII case.
Kind field
Kind: TAtlasColumnKind;The TAtlasColumnKind of the column.
Editable field
Editable: Boolean;False for a read-only column: SetCell raises and TAtlasGrid opens no editor, but AddRow and ImportCSV can fill it.
Width field
Width: Integer;Preferred width in pixels at 96 dpi, at least 16. TAtlasGrid scales it to the monitor DPI.
Examples
List the columns of a table
Prints Number: text, 100 px, read-only and Due: date, 120 px for the table built in the example run.
uses System.SysUtils, Atlas.Data;
procedure DescribeColumns(Table: TAtlasTable);
const
KindNames: array[TAtlasColumnKind] of string = ('text', 'number', 'boolean', 'date');
var
I: Integer;
Column: TAtlasColumn;
begin
for I := 0 to Table.ColumnCount - 1 do
begin
Column := Table.Columns[I]; // a copy of the definition
if Column.Editable then
Writeln(Column.Name, ': ', KindNames[Column.Kind], ', ', Column.Width, ' px')
else
Writeln(Column.Name, ': ', KindNames[Column.Kind], ', ', Column.Width, ' px, read-only');
end;
end;Related
TAtlasTable · TAtlasColumnKind
Also in Atlas VCL
TAtlasTable · TAtlasGrid · TAtlasValueEdit · TAtlasTree · TAtlasWorkbook · TAtlasSheetGrid · TAtlasPivot · TAtlasInspector · TAtlasRichEdit · TAtlasSpellChecker · TAtlasChart · TAtlasGauge · TAtlasThemer · TAtlasWizard · TAtlasWorkspace · TAtlasCommandBar · TAtlasActionTile · TAtlasTileBoard · TAtlasNavigation · TAtlasMap · TAtlasGraph · TAtlasDiagram · TAtlasPrintDocument · TAtlasSchedule · TAtlasScheduler · TAtlasTaskPlan · TAtlasGantt · TAtlasPdfDocument · TAtlasPdfViewer