RadControls for WinForms

Properties

InterceptArrowKeys: This property when true (the default) allows the user to press the UP ARROW and DOWN ARROW keys to select values. The focus must be on the control for this functionality.

ReadOnly: This property when true prevents direct text entry and allows the text values to be changed through the up and down arrows only. By default this property is turned off. 

RightToLeft: If this property is set to Yes the arrow buttons are displayed on the left, text on the right.

Value, Minimum, Maximum: The number displayed in the edit can be set or returned using the Value property. Use the Minimum and Maximum properties to limit the upper and lower bounds that a value may be set to.

Increment: The amount incremented or decremented when the user clicks the up or down arrow buttons. By default this value is "1".

ThousandsSeparator: This property when true displays a thousands separator. By default this property is set to false. The ThousandsSeparator display respects current culture settings as in the example below where the culture is set to German, ThousandsSeparator is true and DecimalPlaces is set to "2".

Copy[C#] Setting the Thousands separator
void Form1_Load(object sender, EventArgs e)
{
    Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
    radSpinEditor1.DecimalPlaces = 2;
    radSpinEditor1.ThousandsSeparator = true;
}
Copy[VB.NET] Setting the Thousands separator
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Thread.CurrentThread.CurrentCulture = New CultureInfo("de-DE")
    RadSpinEditor1.DecimalPlaces = 2
    RadSpinEditor1.ThousandsSeparator = True
End Sub

Events

ValueChanging: This event fires before the value has changed and allows you to prevent a given value from being entered. The event passes a ValueChangingEventArgs parameter that includes the OldValue, NewValue and Cancel properties. Set Cancel to true to prevent the change to the NewValue. The example below stops the value from changing if the new value is greater than twice the size of the old value.

Copy[C#] Cancel changing the value
void radSpinEditor1_ValueChanging(object sender, Telerik.WinControls.UI.ValueChangingEventArgs e)
{
    e.Cancel = Convert.ToDecimal(e.NewValue) * 2 > Convert.ToDecimal(e.OldValue);
}
Copy[VB.NET] Cancel changing the value
Private Sub RadSpinEditor1_ValueChanging(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.ValueChangingEventArgs) Handles RadSpinEditor1.ValueChanging
    e.Cancel = Convert.ToDecimal(e.NewValue) * 2 > Convert.ToDecimal(e.OldValue)
End Sub

ValueChanged: This event fires when the number has already changed. Use the Value property to get the current number in the RadSpinEditor.