The following sample shows how to create columns. The CreateColumns method accepts the following parameters:
AColumns contains captions for new columns. Note that this parameter should be initialized.
ABand represents the band to which the new columns will belong.
procedure CreateColumns(AColumns: TStringList; ABand: TcxTreeListBand);
var
I: Integer;
begin
for I := 0 to AColumns.Count - 1 do
with cxTreeList.CreateColumn(ABand) do
begin
Caption.Text := AColumns[I];
ApplyBestFit;
end;
end;
void __fastcall CreateColumns(TStringList *AColumns, TcxTreeListBand *ABand)
{
TcxTreeListColumn *AColumn;
for (int I = 0; I < AColumns->Count; I++) {
AColumn = cxTreeList->CreateColumn(ABand);
AColumn->Caption->Text = AColumns->Strings[I];
}
}