Back to Devexpress

TcxGridDBBandedTableView.CreateColumn Method

vcl-cxgriddbbandedtableview-dot-tcxgriddbbandedtableview-d1b3bb6e.md

latest2.1 KB
Original Source

TcxGridDBBandedTableView.CreateColumn Method

Creates a column and adds it to the Columns collection of the data-aware Banded Table View, returning a pointer to the column created.

Declaration

delphi
function CreateColumn: TcxGridDBBandedColumn;

Returns

Type
TcxGridDBBandedColumn

Remarks

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:

delphi
//...
with btvItems.CreateColumn do
begin
  Caption := 'Description';
  Name := 'btvItemsDescription';
  DataBinding.FieldName := 'DESCRIPTION';
  PropertiesClass := TcxMemoProperties;
  Position.BandIndex := 1;
  Position.RowIndex := 1;
  Visible := True;
end;
...
cpp
//...
  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

TcxGridDBBandedTableView Members

cxGridDBBandedTableView Unit