Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

Numeric Properties

  • 4 minutes to read

Different formatting is used in a WinForms and ASP.NET UI depending on the type of a numeric property (long, int, decimal, etc., including the same Nullable types).

Note

Refer to the Property Editors | Numeric Properties section in the Feature Center demo installed with XAF to see Numeric Property Editors in action. The Feature Center demo is installed in %PUBLIC%\Documents\DevExpress Demos 20.2\Components.NET Core Desktop Libraries\eXpressApp Framework\FeatureCenter by default. The ASP.NET Web Forms version of this demo is available online at https://demos.devexpress.com/XAF/FeatureCenter/.

Examples

WinForms Property Editors for Numeric Properties

Each WinForms Property Editor has a control that displays a corresponding property in a Detail View, and a repository item that displays a property in a List Editor that supports in-place editing. Both the control and repository item are shown below.

BytePropertyEditor

Control: IntegerEdit - a descendant of the XtraEditors Library’s SpinEdit editor.

Repository Item: RepositoryItemIntegerEdit - a descendant of the XtraEditors Library’s RepositoryItemSpinEdit item.

Description:

Used for byte type properties by default.

Represents the IntegerPropertyEditor class descendant. If the repository item’s MaxValue property is set to 0 or a value that is greater than the Byte.MaxValue value, it is set to the Byte.MaxValue value. If the repository item’s MinValue property is set to 0 or a value that is less than the Byte.MinValue value, it is set to the Byte.MinValue value.

DecimalPropertyEditor

Control: DecimalEdit - a descendant of the SingleEdit editor used by the FloatPropertyEditor.

Repository Item: RepositoryItemDecimalEdit - a RepositoryItemSingleEdit item descendant used by the FloatPropertyEditor.

Description:

Used for decimal type properties by default.

The RepositoryItemSingleEdit class is inherited to store and display values using the “C” Numeric edit mask when the Property Editor’s EditMask is not specified.

DoublePropertyEditor

Control: DoubleEdit - a SingleEdit editor descendant used by the FloatPropertyEditor.

Repository Item: RepositoryItemDoubleEdit - a RepositoryItemSingleEdit item descendant used by the FloatPropertyEditor.

Description:

Used for double type properties by default.

FloatPropertyEditor

Control: SingleEdit - a IntegerEdit editor descendant used by the IntegerPropertyEditor.

Repository Item: RepositoryItemSingleEdit - a RepositoryItemIntegerEdit item descendant used by the IntegerPropertyEditor.

Description:

Used for float type properties by default.

The RepositoryItemIntegerEdit class is inherited to allow the display of float values.

IntegerPropertyEditor

Control: IntegerEdit - a descendant of the XtraEditors Library’s SpinEdit editor.

Repository Item: RepositoryItemIntegerEdit - a descendant of the XtraEditors Library’s RepositoryItemSpinEdit item.

Description:

Used for Int32 type properties by default.

IntegerPropertyEditor has the EditMask property. This property is set to the value of the Views | <DetailView> | Items | <PropertyEditor> node’s IModelCommonMemberViewItem.EditMask property by default. When assigning a value to this property (or the EditMask attribute directly in code), use the syntax of the Numeric mask type. In this instance, the specified mask is applied to the property value displayed by the Property Editor. Refer to the Mask Editors Overview | Mask Types topic for more details.

LongPropertyEditor

Control: IntegerEdit - a descendant of the XtraEditors Library’s SpinEdit editor.

Repository Item: RepositoryItemIntegerEdit - a descendant of the XtraEditors Library’s RepositoryItemSpinEdit item.

Description:

Used for Int64 type properties by default.

Represents the IntegerPropertyEditor class descendant. If the repository item’s MaxValue property is set to 0 or a value that is greater than the Long.MaxValue value, it is set to the Long.MaxValue value. If the repository item’s MinValue property is set to 0 or a value that is less than the Long.MinValue value, it is set to the Long.MinValue value.

ASP.NET Property Editors for Numeric Properties

Each ASP.NET Property Editor has controls that display a property in a Detail View‘s View and Edit mode (see DetailView.ViewEditMode). These controls are listed below.

ASPxBytePropertyEditor

View mode control: System.Web.UI.WebControls.Label.

Edit mode control: ASPxSpinEdit editor from the ASPxEditors Library.

Description:

Used for byte type properties by default.

ASPxDecimalPropertyEditor

View mode control: System.Web.UI.WebControls.Label.

Edit mode control: ASPxSpinEdit editor from the ASPxEditors Library.

Description:

Used for decimal type properties by default. Inherited from the ASPxIntPropertyEditor class.

Uses the “C” edit mask and display format. This Property Editor also enables float value input.

ASPxDoublePropertyEditor

View mode control: System.Web.UI.WebControls.Label.

Edit mode control: ASPxSpinEdit editor from the ASPxEditors Library.

Description:

Used for double type properties by default. Inherited from the ASPxFloatPropertyEditor class. Casts the editor’s value to the double type.

ASPxFloatPropertyEditor

View mode control: System.Web.UI.WebControls.Label.

Edit mode control: ASPxSpinEdit editor from the ASPxEditors Library.

Description:

Used for single type properties by default.

Inherited from the ASPxIntPropertyEditor class. Uses the “F” edit mask and display format by default. This Property Editor also enables float value input.

ASPxIntPropertyEditor

View mode control: System.Web.UI.WebControls.Label.

Edit mode control: ASPxSpinEdit editor from the ASPxEditors Library.

Description:

Used for Int32 type properties by default.

ASPxInt64PropertyEditor

View mode control: System.Web.UI.WebControls.Label.

Edit mode control: ASPxSpinEdit editor from the ASPxEditors Library.

Description:

Used for Int64 type properties by default. Inherited from the ASPxIntPropertyEditor class. Casts the editor’s value to the Int64 type.