Back to Devexpress

TcxCustomGridTableItem.Caption Property

vcl-cxgridcustomtableview-dot-tcxcustomgridtableitem-88f1d6aa.md

latest3.4 KB
Original Source

TcxCustomGridTableItem.Caption Property

Specifies the data item’s caption.

Declaration

delphi
property Caption: string read; write;

Property Value

TypeDescription
string

The data item caption.

|

Remarks

Use the Caption property to specify the required caption for the data item. HeaderAlignmentHorz and HeaderAlignmentVert properties allow you to position the caption within the data item’s header.

Alternative Data Item Caption

All auxiliary dialogs (Customization Form, Quick Customization, etc.) also use the Caption property value to display the data item. You can use the AlternateCaption property to specify an alternative data item caption for these dialogs.

Multi-Line Captions

To display a multi-line data item caption, you need to break the caption string into multiple lines with carriage return/line feed characters (use #13#10 in Delphi and "\n" in C++Builder).

A data item header wraps such a caption string if the header height is sufficient to fit all caption lines. You can use the grid View’s OptionsView.HeaderHeight property to set the required height explicitly or set the OptionsView.HeaderAutoHeight property to True to allow the grid View to adjust the header height according to its content.

Code Example: Display Multi-Line Column Captions

The following code example displays multi-line captions in headers of two unbound banded columns:

delphi
cxGrid1BandedTableView1.OptionsView.HeaderAutoHeight := True;
  cxBandedTableView1Column2.Caption := 'Support' + #13#10 + 'Requests';
  cxBandedTableView1Column3.Caption := 'Last Support' + #13#10 + 'Request';
cpp
cxGrid1BandedTableView1->OptionsView->HeaderAutoHeight = true;
  cxBandedTableView1Column2->Caption = "Support" + "\n" + "Requests";
  cxBandedTableView1Column3->Caption = "Last Support" + "\n" + "Request";

See Also

TcxCustomGridTableItem.HeaderAlignmentHorz Property

TcxCustomGridTableItem.HeaderAlignmentVert Property

TcxCustomGridTableItemOptions.ShowCaption Property

TcxGridTableOptionsView.Header Property

TcxCustomGridTableItem Class

TcxCustomGridTableItem Members

cxGridCustomTableView Unit