Class
RadNumericBox

Represents a special RangeControlBase implementation that allows for numeric input. The control consists of a TextBox part which may be edited with numerical value directly and two buttons to increase/decrease the current value.

Definition

Namespace:Telerik.UI.Xaml.Controls.Input

Assembly:Telerik.WinUI.Controls.dll

Syntax:

cs-api-definition
public class RadNumericBox : RangeInputBase

Inheritance: objectRadControlRadHeaderedControlRangeControlBaseRangeInputBaseRadNumericBox

Inherited Members RangeInputBase.SmallChangePropertyRangeInputBase.LargeChangePropertyRangeInputBase.SmallChangeRangeInputBase.LargeChangeRangeControlBase.MinimumPropertyRangeControlBase.MaximumPropertyRangeControlBase.MinimumRangeControlBase.MaximumRadHeaderedControl.HeaderPropertyRadHeaderedControl.HeaderTemplatePropertyRadHeaderedControl.HeaderStylePropertyRadHeaderedControl.HeaderRadHeaderedControl.HeaderTemplateRadHeaderedControl.HeaderStyleRadControl.EndVisualStateUpdate(bool, bool)RadControl.UpdateVisualState(bool)RadControl.BeginVisualStateUpdate()RadControl.SetVisualState(string, bool)RadControl.CanUpdateVisualState()RadControl.MeasureOverride(Size)RadControl.ArrangeOverride(Size)RadControl.OnApplyTemplate()RadControl.OnIsEnabledChanged(bool, bool)RadControl.LoadCore()RadControl.OnLoaded()RadControl.UnloadCore()RadControl.CurrentVisualStateRadControl.IsLoadedRadControl.IsLoadingRadControl.IsUnloadedRadControl.WasUnloadedRadControl.IsTemplateApplied

Constructors

RadNumericBox()

Initializes a new instance of the RadNumericBox class.

Declaration

cs-api-definition
public RadNumericBox()

Fields

AcceptsDecimalSeparatorProperty

Identifies the AcceptsDecimalSeparator dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty AcceptsDecimalSeparatorProperty

Field Value

DependencyProperty

AllowNullValueProperty

Identifies the AllowNullValue dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty AllowNullValueProperty

Field Value

DependencyProperty

ButtonsVisibilityProperty

Identifies the ButtonsVisibility dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ButtonsVisibilityProperty

Field Value

DependencyProperty

DecimalSeparatorKeyProperty

Identifies the DecimalSeparatorKey dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DecimalSeparatorKeyProperty

Field Value

DependencyProperty

DecreaseButtonStyleProperty

Identifies the DecreaseButtonStyle dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DecreaseButtonStyleProperty

Field Value

DependencyProperty

IncreaseButtonStyleProperty

Identifies the IncreaseButtonStyle dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IncreaseButtonStyleProperty

Field Value

DependencyProperty

InputScopeProperty

Identifies the Value dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty InputScopeProperty

Field Value

DependencyProperty

IsEditableProperty

Identifies the IsEditable dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsEditableProperty

Field Value

DependencyProperty

TextBoxVisibilityProperty

Identifies the TextBoxVisibility dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TextBoxVisibilityProperty

Field Value

DependencyProperty

ValueFormatProperty

Identifies the ValueFormat dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ValueFormatProperty

Field Value

DependencyProperty

ValueFormatSelectorProperty

Identifies the ValueFormatSelector dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ValueFormatSelectorProperty

Field Value

DependencyProperty

ValueProperty

Identifies the Value dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ValueProperty

Field Value

DependencyProperty

ValueStringProperty

Identifies the ValueString dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ValueStringProperty

Field Value

DependencyProperty

WatermarkProperty

Identifies the Watermark dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty WatermarkProperty

Field Value

DependencyProperty

WatermarkTemplateProperty

Identifies the WatermarkTemplate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty WatermarkTemplateProperty

Field Value

DependencyProperty

Properties

AcceptsDecimalSeparator

Gets or sets a value indicating whether the TextBox part of the component may be directly edited through the keyboard.

Declaration

cs-api-definition
public bool AcceptsDecimalSeparator { get; set; }

Property Value

bool

AllowNullValue

Gets or sets a value indicating whether the Value property may be set to null.

Declaration

cs-api-definition
public bool AllowNullValue { get; set; }

Property Value

bool

ButtonsVisibility

Gets or sets the Visibility value for the Increase and Decrease buttons. The default value is Visible.

Declaration

cs-api-definition
public Visibility ButtonsVisibility { get; set; }

Property Value

Visibility

Example

xaml
<telerikInput:RadNumericBox x:Name="numericBox" ButtonsVisibility="Collapsed"/>
c
this.numericBox.ButtonsVisibility = Visibility.Collapsed;

DecreaseButtonStyle

Gets or sets the Style object that defines the appearance of the DecreaseButton control part. The TargetType of the Style object should point to the InlineButton type.

Declaration

cs-api-definition
public Style DecreaseButtonStyle { get; set; }

Property Value

Style

Example

xaml
<telerikInput:RadNumericBox.DecreaseButtonStyle>
   <Style TargetType="PrimitivesCommon:InlineButton">
       <Setter Property="Background" Value="Red"/>
       <Setter Property="Width" Value="35"/>
       <Setter Property="Height" Value="35"/>
   </Style>
</telerikInput:RadNumericBox.DecreaseButtonStyle>

IncreaseButtonStyle

Gets or sets the Style object that defines the appearance of the IncreaseButton control part. The TargetType of the Style object should point to the InlineButton type.

Declaration

cs-api-definition
public Style IncreaseButtonStyle { get; set; }

Property Value

Style

Example

xaml
<telerikInput:RadNumericBox.IncreaseButtonStyle>
     <Style TargetType="PrimitivesCommon:InlineButton">
         <Setter Property="Background" Value="Red"/>
         <Setter Property="Width" Value="35"/>
         <Setter Property="Height" Value="35"/>
     </Style>
 </telerikInput:RadNumericBox.IncreaseButtonStyle>

InputScope

Gets or sets the context for input used by this RadNumericBox.

Declaration

cs-api-definition
public InputScopeNameValue InputScope { get; set; }

Property Value

InputScopeNameValue

IsEditable

Gets or sets a value indicating whether the TextBox part of the component can be directly edited through the keyboard. The default value is true.

Declaration

cs-api-definition
public bool IsEditable { get; set; }

Property Value

bool

Example

xaml
<telerikInput:RadNumericBox x:Name="numericBox" IsEditable="False"/>

C#

c
this.numericBox.IsEditable = false;

TextBoxVisibility

Gets or sets the Visibility value for the TextBox part. The default value is Visible.

Declaration

cs-api-definition
public Visibility TextBoxVisibility { get; set; }

Property Value

Visibility

Example

xaml
<telerikInput:RadNumericBox x:Name="numericBox" TextBoxVisibility="Collapsed"/>
c
this.numericBox.TextBoxVisibility = Visibility.Collapsed;

Value

Gets or sets the currently displayed value. The value may be coerced to fit the current range restrictions.

Declaration

cs-api-definition
public double? Value { get; set; }

Property Value

double?

The default value is 0.

ValueFormat

Gets or sets the string that is used to format the current Value of the component. The String.Format routine is used and the value specified should be in the form required by this method: { index[,alignment][ :formatString] }.

Declaration

cs-api-definition
public string ValueFormat { get; set; }

Property Value

string

Example

xaml
<telerikInput:RadNumericBox x:Name="numericBox" ValueFormat="{}{0:C}" />

C#

c
this.numericBox.ValueFormat = "{0:C}";

ValueFormatSelector

Gets or sets the IFormatSelector that is used to determine the format for the current Value of the component. The String.Format routine is used and the value specified should be in the form required by this method: { index[,alignment][ :formatString] }.

Declaration

cs-api-definition
public IFormatSelector ValueFormatSelector { get; set; }

Property Value

IFormatSelector

ValueString

Gets the current string representation of the Value property, as displayed in the TextBox part.

Declaration

cs-api-definition
public string ValueString { get; }

Property Value

string

Watermark

Gets or sets the object that represents the Watermark displayed by the control. The Watermark is visible when the current Value is not set (null).

Declaration

cs-api-definition
public object Watermark { get; set; }

Property Value

object

The default value is null

Example

xaml
<telerikInput:RadNumericBox x:Name="numericBox" Watermark="WaterMark"/>
c
this.numericBox.Watermark = "WaterMark";

WatermarkTemplate

Gets or sets the DataTemplate instance that defines the appearance of the Watermark value.

Declaration

cs-api-definition
public DataTemplate WatermarkTemplate { get; set; }

Property Value

DataTemplate

Example

xaml
<telerikInput:RadNumericBox x:Name="numericBox">
 <telerikInput:RadNumericBox.WatermarkTemplate>
    <DataTemplate>
         <Ellipse Width="20" Height="20" Fill="Red" Stroke="Red"/>
     </DataTemplate>
  </telerikInput:RadNumericBox.WatermarkTemplate>
</telerikInput:RadNumericBox>

Methods

ApplyTemplateCore()

Called when the Framework is called. Inheritors should override this method should they have some custom template-related logic. This is done to ensure that the property is properly initialized.

Declaration

cs-api-definition
protected override bool ApplyTemplateCore()

Returns

bool

Overrides RadControl.ApplyTemplateCore()

ComposeVisualStateName()

Builds the current visual state for this instance.

Declaration

cs-api-definition
protected override string ComposeVisualStateName()

Returns

string

Overrides RadControl.ComposeVisualStateName()

OnCreateAutomationPeer()

Declaration

cs-api-definition
protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

Overrides RangeInputBase.OnCreateAutomationPeer()

OnGotFocus(RoutedEventArgs)

Called before the GotFocus event occurs.

Declaration

cs-api-definition
protected override void OnGotFocus(RoutedEventArgs e)

Parameters

e

RoutedEventArgs

The data for the event.

OnPointerWheelChanged(PointerRoutedEventArgs)

Called before the PointerWheelChanged event occurs.

Declaration

cs-api-definition
protected override void OnPointerWheelChanged(PointerRoutedEventArgs e)

Parameters

e

PointerRoutedEventArgs

Event data for the event.

OnTemplateApplied()

Occurs when the method has been called and the template is already successfully applied.

Declaration

cs-api-definition
protected override void OnTemplateApplied()

Overrides RangeControlBase.OnTemplateApplied()

OnValueChanged()

Occurs when the property has changed. Raises the event.

Declaration

cs-api-definition
protected virtual void OnValueChanged()

UnapplyTemplateCore()

Removes the current control template. Occurs when a template has already been applied and a new one is applied.

Declaration

cs-api-definition
protected override void UnapplyTemplateCore()

Overrides RadControl.UnapplyTemplateCore()

Events

ValueChanged

Occurs when the current value has changed.

Declaration

cs-api-definition
public event EventHandler ValueChanged

Event Value

EventHandler