Skip to main content

FormatInfo Class

Provides formatting settings.

Namespace: DevExpress.Utils

Assembly: DevExpress.Data.v22.2.dll

NuGet Package: DevExpress.Data


public class FormatInfo :


There may be situations when you need to apply formatting to the values displayed by a control. For instance, you may need to display numeric values in currency format, scientific notation, etc. Controls provided by Developer Express declare properties that expose the FormatInfo object, thus enabling you to apply the required formatting. For instance, in container controls these objects are exposed via the properties of its data field objects (e.g. columns).

There are two ways you can apply formatting using an object’s FormatInfo settings:

  • specify a format string using the FormatInfo.FormatString property. In this case, the FormatInfo.FormatType property should be set to FormatType.DateTime or FormatType.Numeric indicating the type of formatted values. Format strings that can be assigned to the FormatInfo.FormatString property can be found in the Standard Numeric Format Strings, Custom Numeric Format Strings, Standard Date and Time Format Strings and Custom Date and Time Format Strings topics of the Visual Studio .NET Documentation.
  • implement a custom formatter object and assign it to the FormatInfo.Format property. In this case, the FormatInfo.FormatType property should be set to FormatType.Custom. Use this formatting method when the format strings provided do not suit your needs. In this case, you can provide any formatting algorithm required.

See Formatting Values, to learn more.


The sample code below formats display values of the date and text editors. The FormatInfo.FormatType and FormatInfo.FormatString properties of the editor’s RepositoryItem.DisplayFormat object are used for this purpose.

The image below displays the editors before and after formatting their display values.

Formatting - Standard

dateEdit1.Properties.DisplayFormat.FormatType = FormatType.DateTime;
dateEdit1.Properties.DisplayFormat.FormatString = "MMMM/yyyy";
textEdit1.Properties.DisplayFormat.FormatType = FormatType.Numeric;
textEdit1.Properties.DisplayFormat.FormatString = "c2";

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FormatInfo class.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.



See Also