vcl-cxgriddbbandedtableview-dot-tcxgriddbbandedtableview-d1b3bb6e.md
Creates a column and adds it to the Columns collection of the data-aware Banded Table View, returning a pointer to the column created.
function CreateColumn: TcxGridDBBandedColumn;
| Type |
|---|
| TcxGridDBBandedColumn |
Use the CreateColumn method to create a column and add it to the View column collection. This collection can be accessed via the Columns property. After a column is created a user can specify its settings: connection to a data field, behavior options and styles, position within a band, etc.
The following code shows how to use the CreateColumn method:
//...
with btvItems.CreateColumn do
begin
Caption := 'Description';
Name := 'btvItemsDescription';
DataBinding.FieldName := 'DESCRIPTION';
PropertiesClass := TcxMemoProperties;
Position.BandIndex := 1;
Position.RowIndex := 1;
Visible := True;
end;
...
//...
TcxGridDBBandedColumn *ADBColumn;
ADBColumn = btvItems->CreateColumn();
ADBColumn->Caption = "Description";
ADBColumn->Name = "btvItemsDescription";
ADBColumn->DataBinding->FieldName = "DESCRIPTION";
ADBColumn->PropertiesClass = TcxMemoProperties;
ADBColumn->Position->BandIndex = 1;
ADBColumn->Position->RowIndex = 1;
ADBColumn->Visible = True;
end;
...
See Also
TcxGridDBBandedTableView.Columns
TcxGridDBDataController.CreateAllItems
TcxGridDBBandedTableView Class