New to Telerik UI for WinForms? Start a free 30-day trial

Represents a numeric up/down editor.

Definition

Constructors

C#
public BaseSpinEditor()

Fields

Stores the selected text length captured before the OnKeyDown(KeyEventArgs) hook runs.

C#
protected int selectionLength

Stores the text selection start captured before the OnKeyDown(KeyEventArgs) hook runs.

C#
protected int selectionStart

Properties

Gets decimal, the value type reported by this editor to data-bound consumers.

C#
public override Type DataType { get; }

Overrides: BaseInputEditor.DataType

Gets or sets the number of decimal places to display in the editor.

C#
public int DecimalPlaces { get; set; }

Gets or sets the maximum value that could be set in the editor.

C#
public decimal MaxValue { get; set; }

Gets or sets the minimum value that could be set in the editor.

C#
public decimal MinValue { get; set; }

Gets or sets the value which is added to/subtracted from the current value of the editor.

C#
public decimal Step { get; set; }

Gets or sets a value indicating whether a thousands separator is displayed in the editor.

C#
public bool ThousandsSeparator { get; set; }

Gets the current numeric value after validating the editor text, or null when the text is empty. Assigning a value converts it to a decimal and constrains it to the spin element's range; values that cannot be converted fall back to its minimum.

C#
public override object Value { get; set; }

Overrides: BaseInputEditor.Value

Gets or sets the type of the value to use in the editor.

C#
public Type ValueType { get; set; }

Methods

Enters edit mode, attaches the spin-element event handlers, selects the text, and focuses the hosted text box.

C#
public override void BeginEdit()

Overrides: BaseInputEditor.BeginEdit()

Creates the spin editor element used to display and edit the numeric value.

C#
protected override RadElement CreateEditorElement()
Returns:

RadElement

A new BaseSpinEditorElement.

Overrides: BaseInputEditor.CreateEditorElement()

Detaches the spin-element event handlers and resets its value to MinValue after ending the base edit session.

C#
public override bool EndEdit()
Returns:

bool

true after the edit session is ended.

Overrides: BaseInputEditor.EndEdit()

Sets the spin element's initial bounds to the 32-bit integer range before initializing the owner and value.

C#
public override void Initialize(object owner, object value)
Parameters:ownerobject

The element that owns the editor.

valueobject

The initial editor value.

Overrides: BaseInputEditor.Initialize(object, object)

Handles a key-down notification from the spin element. The selection fields are captured before this hook is called.

C#
protected virtual void OnKeyDown(KeyEventArgs e)
Parameters:eKeyEventArgs

The key event data.

Handles a key-up notification from the spin element.

C#
protected virtual void OnKeyUp(KeyEventArgs e)
Parameters:eKeyEventArgs

The key event data.

Runs when the hosted text box loses focus or the spin element no longer contains focus. Override to handle focus loss for a specialized editor.

C#
public virtual void OnLostFocus()

Validates the spin element's text before running the base editor validation, which restores the original value if validation is canceled.

C#
public override bool Validate()
Returns:

bool

true when the base editor accepts the value; otherwise, false.

Overrides: BaseInputEditor.Validate()