corelibraries-devexpress-dot-utils-48359aa8.md
Provides formatting settings.
Namespace : DevExpress.Utils
Assembly : DevExpress.Data.v25.2.dll
NuGet Package : DevExpress.Data
public class FormatInfo :
ViewStatePersisterCore,
IXtraSerializable
Public Class FormatInfo
Inherits ViewStatePersisterCore
Implements IXtraSerializable
The following members return FormatInfo objects:
Show 28 links
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:
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.
dateEdit1.Properties.DisplayFormat.FormatType = FormatType.DateTime;
dateEdit1.Properties.DisplayFormat.FormatString = "MMMM/yyyy";
textEdit1.Properties.DisplayFormat.FormatType = FormatType.Numeric;
textEdit1.Properties.DisplayFormat.FormatString = "c2";
DateEdit1.Properties.DisplayFormat.FormatType = FormatType.DateTime
DateEdit1.Properties.DisplayFormat.FormatString = "MMMM/yyyy"
TextEdit1.Properties.DisplayFormat.FormatType = FormatType.Numeric
TextEdit1.Properties.DisplayFormat.FormatString = "c2"
Object ViewStatePersisterCore FormatInfo
See Also