Back to Devexpress

ASPxSpinEdit Class

aspnet-devexpress-dot-web-ff219a61.md

latest8.5 KB
Original Source

ASPxSpinEdit Class

Represents the spin edit control.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ASPxSpinEdit :
    ASPxSpinEditBase,
    IAllowNullOwner
vb
Public Class ASPxSpinEdit
    Inherits ASPxSpinEditBase
    Implements IAllowNullOwner

Remarks

The ASPxSpinEdit class represents an editor consisting of an edit region and one or two pairs of spin buttons which can be used to adjust the numerical value. This value is specified via the ASPxSpinEdit.Number property.

Create a SpinEdit Control

Design Time

The ASPxSpinEdit control is available on the DX.25.2: Common Controls toolbox tab in the Microsoft Visual Studio IDE.

Drag the control onto a form and customize the control’s settings, or paste the control’s markup in the page’s source code.

aspx
<dx:ASPxSpinEdit ID="spinEdit" runat="server" Number="1" LargeIncrement="5" >
    <SpinButtons ShowIncrementButtons="False" ShowLargeIncrementButtons="True" />
</dx:ASPxSpinEdit>

Run Time

csharp
using DevExpress.Web;
...
protected void Page_Load(object sender, EventArgs e)
{
    ASPxSpinEdit spinEdit = new ASPxSpinEdit();
    spinEdit.ID = "spinEdit";
    Page.Form.Controls.Add(spinEdit);

    spinEdit.Number = 1;
    spinEdit.SpinButtons.ShowIncrementButtons = false;
    spinEdit.SpinButtons.ShowLargeIncrementButtons = true;
    spinEdit.LargeIncrement = 5;
}
vb
Imports DevExpress.Web

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    Dim spinEdit As ASPxSpinEdit = New ASPxSpinEdit()
    spinEdit.ID = "spinEdit"
    Page.Form.Controls.Add(spinEdit)

    spinEdit.Number = 1
    spinEdit.SpinButtons.ShowIncrementButtons = False
    spinEdit.SpinButtons.ShowLargeIncrementButtons = True
    spinEdit.LargeIncrement = 5
End Sub

Note

DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.

The appearance and position of spin buttons can be controlled using the settings available via the ASPxSpinEdit.SpinButtons property.

When an end-user presses a small or large spin button, the ASPxSpinEdit.Number property’s value is incremented or decremented by the amount specified by the ASPxSpinEdit.Increment or ASPxSpinEdit.LargeIncrement property respectively. The value of the ASPxSpinEdit control can also be changed using mouse wheel and keyboard (the ARROW UP and ARROW DOWN keys - for small increment/decrement; the CTRL+ARROW UP and CTRL+ARROW DOWN or PAGE UP and PAGE DOWN keys - for large increment/decrement).

The ASPxSpinEdit.Number property’s value can be limited via the ASPxSpinEdit.MinValue and ASPxSpinEdit.MaxValue properties. Note, that these limitations are not applicable to the ASPxSpinEdit.Value property of the ASPxSpinEdit. The ASPxSpinEdit.Value property can be assigned a value that exceeds the specified limits, but editing can only be applied within these limits. If the ASPxSpinEdit.AllowNull property is set to true, the ASPxSpinEdit can accept null values.

The ASPxSpinEdit control can function in float or integer editing mode depending upon the ASPxSpinEdit.NumberType property’s setting. In integer mode, float value input is disabled and float values displayed within the editor are automatically rounded after they has been modified. In float mode, culture specific separators are supported, allowing decimal separators to display uniquely in various cultures. The number of decimal places can be defined using the ASPxSpinEdit.DecimalPlaces property.

Note

The client-side equivalent of this editor control is represented by the ASPxClientSpinEdit object. The client editor object can be accessed directly by the name specified via the ASPxEditBase.ClientInstanceName property. The editor’s client-side API is enabled if the ASPxEditBase.EnableClientSideAPI property is set to true, or any client event is handled. Available client events can be accessed via the ASPxSpinEdit.ClientSideEvents property.

Implements

Show 17 items

IComponent

IDisposable

IParserAccessor

IDataBindingsAccessor

IControlBuilderAccessor

IControlDesignerAccessor

IExpressionsAccessor

IAttributeAccessor

IUrlResolutionService

INamingContainer

IPostBackDataHandler

ICallbackEventHandler

IPropertiesOwner

IDataSourceViewSchemaAccessor

IEditableTextControl

ITextControl

IPostBackEventHandler

Inheritance

Show 17 items

Object Control WebControl ASPxWebControlBase ASPxWebControl ASPxDataWebControlBase ASPxDataWebControl ASPxEditBase ASPxEdit ASPxTextEdit ASPxPureTextBoxBase ASPxTextBoxBase ASPxButtonEditBase ASPxSpinEditBase ASPxSpinEdit BootstrapSpinEdit

MVCxSpinEdit

See Also

ASPxSpinEdit Members

Spin Editor

DevExpress.Web Namespace