LookUpColumnInfo.FormatType Property
Gets or sets the type of formatting applied when displaying column values.
Namespace: DevExpress.XtraEditors.Controls
Assembly: DevExpress.XtraEditors.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
#Declaration
[DefaultValue(FormatType.None)]
[DXCategory("Format")]
public FormatType FormatType { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
Format |
None | The Format |
Available values:
Name | Description |
---|---|
None | No formatting is performed. Setting the Format |
Numeric | Specifies that values should be formatted as numbers. Setting Format Also Format |
Date |
Specifies that values should be formatted as the Date Setting Format |
Custom | Use Custom to format string values. Use Custom when assigning a custom IFormat Setting Format |
#Remarks
Use the FormatType and LookUpColumnInfo.FormatString properties to apply formatting to column values.
An editor needs to know the type of data displayed in the column in order to recognize the pattern used to format column values. If column values are numeric, set the FormatType to FormatType.Numeric. If the column displays date/time values, set the property to FormatType.DateTime. The FormatType.None value indicates that no formatting is to be applied.
To specify the format pattern, see the LookUpColumnInfo.FormatString property. The Format Specifiers document provides more information on the format strings available.
Note: after changing the format type, FormatInfo.FormatString is cleared. So you need to set FormatInfo.FormatString after the format type is specified.
If you create columns using the RepositoryItemLookUpEdit.PopulateColumns method, the editor automatically sets the appropriate FormatType value for columns bound to numeric and date/time fields.