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

Edits numeric PropertyGrid values with a spin editor, honoring property ranges and nullable numeric types.

Definition

Constructors

C#
public PropertyGridSpinEditor()

Properties

Gets whether the current numeric value differs from the original value, treating null and DBNull as empty values.

C#
public override bool IsModified { get; }

Overrides: BaseInputEditor.IsModified

Gets the validated numeric value, returning null when the editor text is empty; assigned values are clamped to the editor's bounds.

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

Overrides: BaseSpinEditor.Value

Methods

Configures precision and null input from the edited property type and current multi-selection value, initializes the base editor, and applies the property's numeric bounds.

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

The PropertyGrid row that owns the editor.

valueobject

The value to display initially.

Overrides: BaseSpinEditor.Initialize(object, object)

Commits on Enter unless the modifiers are exactly Control, cancels on Escape, and clears a fully selected value on Delete without validating it.

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

The key-down event data.

Overrides: BaseSpinEditor.OnKeyDown(KeyEventArgs)

Validates when Left or Right moves the caret to the corresponding text boundary, accounting for right-to-left layout.

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

The key-up event data.

Overrides: BaseSpinEditor.OnKeyUp(KeyEventArgs)

Ends the edit when focus leaves the owning PropertyGrid control and the visual row is still valid.

C#
public override void OnLostFocus()

Overrides: BaseSpinEditor.OnLostFocus()

Notifies the owning PropertyGrid table after the editor value changes.

C#
public override void OnValueChanged()

Overrides: BaseInputEditor.OnValueChanged()

Forwards the editor's proposed value change to the owning PropertyGrid table.

C#
public override void OnValueChanging(ValueChangingEventArgs e)
Parameters:eValueChangingEventArgs

The proposed value and cancellation state.

Overrides: BaseInputEditor.OnValueChanging(ValueChangingEventArgs)

Applies a RadRangeAttribute when present; otherwise assigns built-in bounds for supported non-nullable numeric type codes. Nullable numeric types are not unwrapped here and receive no fallback bounds.

C#
protected virtual void SetMinAndMaxValue(PropertyGridItem item)
Parameters:itemPropertyGridItem

The numeric PropertyGrid item being edited.