[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Expand]Controls and Libraries
 [Collapse]Common Features
  [Expand]Data Binding Common Concepts
  [Expand]Data Source Wizard
  [Expand]Application Appearance and Skin Colors
  [Expand]Filtering UI Context
   Find Panel Syntax
  [Expand]Graphics Performance and High DPI
  [Expand]Scaffolding Wizard
  [Collapse]Formatting Values
    How to: Format Date-Time Values Using the LongDate Pattern
    How to: Format Date-Time Values Using a Custom Format Pattern
    How to: Format a Numeric Value according to its Sign
    How to: Add Custom Text to a Formatted String
    How to: Create a Custom Formatter to Change the Case of String Values
    How to: Create a Custom Formatter to Represent Decimal Values in Binary
    Formatting Approaches
    Members that Support the Formatting Mechanism
    Format Specifiers
    Composite Formatting
    Custom Formatting
   HTML-inspired Text Formatting
  [Expand]Tooltip Management
  [Expand]Save and Restore Layouts
   Clipboard - Copy and Paste Operations. Data Formatting
   Version Compatibility: Default Property Values
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Members that Support the Formatting Mechanism

Expanded Format Settings

DevExpress controls that support the formatting mechanism contain properties of the FormatInfo class, which specify the settings used to format different control elements. The FormatInfo class declares two properties that are available at design time: FormatInfo.FormatType and FormatInfo.FormatString.

The FormatInfo.FormatType property has to be set to an appropriate value that identifies the type of the values that need to be formatted.

FormatInfo.FormatType value



Specifies that numeric values have to be formatted.


Specifies that date/time values have to be formatted.


No formatting should be applied.


Specifies that:

The FormatInfo.FormatString property needs to be set to a format specifier or format string that consists of the format specifiers. This will specify the pattern according to which values should be formatted.

There is a set of predefined format specifiers to format numeric and date/time values. The output produced depends upon the regional settings of an end-user's computer. However, these specifiers allow you to format values according to the predefined formats (for instance, a date/time value can be formatted in the Short Date, Long Date or Full Date/Time form as defined in the system).

If you need greater control over formatting, you need to use custom format strings. Such format strings allow you to construct your own formatting patterns, add custom text to formatted values, specify different formats for positive and negative numeric values, etc. However, when using custom format strings, you cannot always format values so that they are correctly displayed with respect to the user's regional options. In this case, it is best to construct the format string at runtime so that regional settings can be taken into account. The Thread.CurrentThread.CurrentCulture property can be used to do this.


Set the FormatInfo.FormatString only after changing the FormatInfo.FormatType property. Otherwise, your format string will be lost.

See the Format Specifiers topic for information on the available format specifiers.

Expanded Properties Exposed by the DevExpress Controls

The following table lists the properties of the FormatInfo type that are exposed by DevExpress WinForms controls.

DevExpress Control

Format Property

Grid Control

GridColumn.DisplayFormat - formats column values.

DevExpress Editors Library

RepositoryItem.DisplayFormat - formats values within unfocused editors;

RepositoryItem.EditFormat - formats values within focused editors.

To allow end-users to enter text within editors according to specific patterns, use masks. Masks can also be used to format values even in display mode (when an editor is not active).

Tree List Control

TreeListColumn.Format - formats column values.

DevExpress Vertical Grid

RowProperties.Format - formats row values.


PivotGridFieldBase.CellFormat - formats values within the Data Area;

PivotGridFieldBase.ValueFormat - formats values within the Column Header Area and Row Header Area;

PivotGridFieldBase.TotalCellFormat - formats totals;

PivotGridFieldBase.GrandTotalCellFormat - formats grand totals.

Is this topic helpful?​​​​​​​