Skip to main content

TdxSpreadSheetTableView.Columns Property

Provides access to the column collection within the current Table View worksheet.

Declaration

property Columns: TdxSpreadSheetTableColumns read;

Property Value

Type
TdxSpreadSheetTableColumns

Remarks

Use this property to manage the collection of column objects in the Table View worksheet and customize the default width of columns.

Since the Columns property provides zero-based indexed access to individual elements of the collection, you can use it to customize any of the column objects you created earlier.

The following code example demonstrates how to use the Columns property to customize the style of a column and all cells within it.

//...
var
  ATableView: TdxSpreadSheetTableView;
  AColumn: TdxSpreadSheetTableColumn;
//...
  ATableView := TdxSpreadSheetTableView(dxSpreadSheet1.ActiveSheet);
  if(ATableView.Columns[2] = nil) then
    begin
      ATableView.Columns.CreateItem(2);
// Creating the column object for individual customization
    end;
// An indexed access to the third column in a Table View
  AColumn := ATableView.Columns[2];
  AColumn.Style.Borders[bLeft].Color := clBlue;
  AColumn.Style.Borders[bLeft].Style := sscbsMediumDashDotDot;
  AColumn.Style.Borders[bRight].Color := clBlue;
  AColumn.Style.Borders[bRight].Style := sscbsMediumDashDotDot;
  AColumn.Style.Brush.Style := sscfsRevDiagonalStrip;
  AColumn.Style.Brush.BackgroundColor := clHotLight;
  AColumn.Style.Brush.ForegroundColor := clSkyBlue;

For additional information, refer to the Table Item Appearance Customization Level topic.

See Also