Back to Devexpress

TcxGridDBTableView.Columns Property

vcl-cxgriddbtableview-dot-tcxgriddbtableview-1146b044.md

latest2.0 KB
Original Source

TcxGridDBTableView.Columns Property

Provides indexed access to the collection of the View’s columns.

Declaration

delphi
property Columns[Index: Integer]: TcxGridDBColumn read; write;

Property Value

Type
TcxGridDBColumn

Remarks

Use the Columns property to access the collection of columns. Each column consists of an instance of the TcxGridDBColumn class. This class is a TcxGridColumn class descendant and it redefines the Item.DataBinding property to work with the TDataSet and its descendants. Each column also provides properties for defining sets of options & styles controlling the column’s look & feel, an editor for its values, etc.

The following code shows how to use the Columns property to access all View columns and to change their captions:

delphi
for I := 0 to OrdersView.ColumnCount - 1 do
  OrdersView.Columns[I].Caption := 'Column' + IntToStr(I + 1);
cpp
for (int I = 0; I < OrdersView.ColumnCount; I++)
  OrdersView->Columns[I]->Caption = "Column" + IntToStr(I + 1);

See Also

TcxGridColumn

TcxGridDBColumn

TcxGridDBDataController.CreateAllItems

TcxGridDBTableView.CreateColumn

TcxGridTableView.ColumnCount

TcxGridDBTableView Class

TcxGridDBTableView Members

cxGridDBTableView Unit