Skip to main content

GridColumn.Caption Property

Gets or sets the column‘s display caption. This is a bindable property.

Namespace: DevExpress.Mobile.DataGrid

Assembly: DevExpress.Mobile.Grid.v18.2.dll

Declaration

[XtraSerializableProperty]
public string Caption { get; set; }

Property Value

Type Description
String

A String value specifying the column’s display caption.

Remarks

Important

This documentation topic describes legacy technology. We no longer develop new functionality for the GridControl and suggest that you use the new DataGridView control instead.

In the grid, column captions are displayed in column headers.

By default, the Caption property is set to an empty string. In this case, a friendly caption is generated for a column based on its GridColumn.FieldName property. Friendly captions are generated by adding SPACE characters between parts of the field name starting with uppercase letters. For example, if the field name is “CustomerName”, the display caption will be “Customer Name”. To obtain a column caption as it is displayed in a column header, use the GridColumn.ActualCaption property.

To override the default display caption, assign it to the Caption property.

To control the visibility of column headers in the GridControl, use the GridControl.ColumnHeadersVisibility property.

Example

This example shows how to create and customize grid columns for displaying and editing data of different types (text, numbers, dates and Boolean values). The specified collection contains columns bound to the data source fields (Product.Name, Product.UnitPrice, Quantity, Date and Shipped) and one unbound column (Total) displaying data values calculated according to a formula based on the values of other columns.

The image below illustrates the result.

Grid_GettingStarted_Lesson2_Result_iOS

Grid_GettingStarted_Lesson2_Result_Android_Dark

See Also