Skip to main content

GridColumn.DisplayFormat Property

Gets or sets formatting for values in the column. This is a bindable property.

Namespace: DevExpress.Mobile.DataGrid

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

Declaration

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

Property Value

Type Description
String

A string that specifies the format pattern.

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.

Use the DisplayFormat property to specify the format for numeric and date/time values displayed in the column. To compose format patterns, you can use standard or custom format specifiers (they are listed and described in the Standard Numeric Format Strings, Custom Numeric Format Strings, Standard Date and Time Format Strings and Custom Date and Time Format Strings topics in MSDN).

Example

This example shows how to format column values using the standard format strings. Values in the Price column are formatted as a currency amount, values in the Date column are formatted using the Short Date Pattern.

GridColumn_DisplayFormat

<dxGrid:GridControl.Columns>
    <!-- ... -->
    <dxGrid:NumberColumn FieldName="Price" DisplayFormat="c2"/>
    <dxGrid:DateColumn FieldName="Date" DisplayFormat="d"/>
    <!-- ... -->
</dxGrid:GridControl.Columns>
See Also