Class SfNumericTextBox
Represents a control that allows users enter only numeric values. It can be configured to display different formats such as currency format, scientific format, etc.
Namespace: Syncfusion.SfNumericTextBox.XForms
Assembly: Syncfusion.SfNumericTextBox.XForms.dll
Syntax
public class SfNumericTextBox : View, IParentThemeElement, IThemeElement
Remarks
The SfNumericTextBox is inherited from Xamarin.Forms.View
Constructors
SfNumericTextBox()
Initializes a new instance of the SfNumericTextBox class.
Declaration
public SfNumericTextBox()
Fields
AllowDefaultDecimalDigitsProperty
Backing store for the AllowDefaultDecimalDigits bindable property.
Declaration
public static readonly BindableProperty AllowDefaultDecimalDigitsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
AllowNullProperty
Identifies the AllowNull property. It indicates whether to enter null or not in numeric text box. Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowNullProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
BorderColorProperty
Identifies the border color property. It is used to change the border color of numeric text box Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty BorderColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ClearButtonVisibilityProperty
Backing store for the ClearButtonVisibility bindable property.
Declaration
public static readonly BindableProperty ClearButtonVisibilityProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
CultureProperty
Identifies the Culture property. It is used to set culture to numeric text box. Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty CultureProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
EnableGroupSeparatorProperty
Identifies the EnableGroupSeparator property. It is used to indicate whether separate number or not Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty EnableGroupSeparatorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
FontAttributesProperty
Identifies the font attribute property. It is used to change the font of text to either bold or italic Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty FontAttributesProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
FontFamilyProperty
Identifies the FontFamily property. It is used to set font family of text in numeric text box Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty FontFamilyProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
FontProperty
Identifies the Font property. It is used to set font in numeric text box Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty FontProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
FontSizeProperty
Identifies font size. It is used to change the font size of text Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty FontSizeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
FormatStringProperty
Identifies the FormatString property. It determines the format indicator by which the display text has to be formatted. Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty FormatStringProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
GroupSeparatorModeProperty
Identifies the GroupSeparatorMode property. It is used to change the group separator active mode.
Declaration
public static readonly BindableProperty GroupSeparatorModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
IsReadOnlyProperty
Backing store for the IsReadOnly bindable property.
Declaration
public static readonly BindableProperty IsReadOnlyProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MaximumNumberDecimalDigitsProperty
Identifies the MaximumNumberDecimalDigits property. It is used to set number of zero after the decimal point. Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty MaximumNumberDecimalDigitsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
MaximumProperty
Identifies the Maximum property. It is used to set maximum value to numeric text box. Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty MaximumProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
MinimumProperty
Identifies the Minimum property. It is used to set Minimum value to numeric text box. Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty MinimumProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ParserModeProperty
Identifies the ParserMode property. It is used to set parse mode to either decimal or double Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ParserModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
PercentDisplayModeProperty
Identifies the PercentDisplayMode property. It is used to set PercentDisplayMode to either value or compute Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty PercentDisplayModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ReturnCommandParameterProperty
Identifies the ReturnCommandParameter property. It specifies the command parameter for return key. Xamarin.Forms.BindableProperty control.
Declaration
public static readonly BindableProperty ReturnCommandParameterProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ReturnCommandProperty
Identifies the ReturnCommand property. It specifies the event for command for return type. Xamarin.Forms.BindableProperty control.
Declaration
public static readonly BindableProperty ReturnCommandProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ReturnTypeProperty
Identifies the ReturnType property. It specifies the return type value for numeric text box Xamarin.Forms.BindableProperty control.
Declaration
public static readonly BindableProperty ReturnTypeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
SelectAllOnFocusProperty
Identifies the SelectAllOnFocus property. It is used to select value of numeric text box when numeric text box is on the focus state Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SelectAllOnFocusProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
TextAlignmentProperty
Identifies the TextAlignment property. It is used to align the value of numeric text box. Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty TextAlignmentProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
TextColorProperty
Identifies the text color property. It is used to change the color of text Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty TextColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ValueChangeModeProperty
Identifies the ValueChangeMode property. It is used to set ValueChangeMode to either value or compute Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ValueChangeModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ValueProperty
Identifies the Value property. It is used to set value to the numeric text box. Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ValueProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
WatermarkColorProperty
Identifies the WatermarkColor property. It is used to set watermark custom color of NumericTextBox's watermark text Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty WatermarkColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
WatermarkProperty
Identifies the Watermark property. It is used to set the default watermark text. Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty WatermarkProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
Properties
AllowDefaultDecimalDigits
Gets or sets a value indicating whether to allow the default decimal digits while the control is unfocused.
Declaration
public bool AllowDefaultDecimalDigits { get; set; }
Property Value
Type |
---|
System.Boolean |
AllowNull
Gets or sets a value indicating whether the null value can be set or not in the input field of numeric text box.
Declaration
public bool AllowNull { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
BorderColor
Gets or sets the BorderColor of the input field. This property can be used to change the border color of numeric text box.
Declaration
public Color BorderColor { get; set; }
Property Value
Type |
---|
Xamarin.Forms.Color |
ClearButtonVisibility
Gets or sets a value indicating whether to display a clear button, which is used to clear the text entered in SfNumericTextBox.
Declaration
public ClearButtonVisibilityMode ClearButtonVisibility { get; set; }
Property Value
Type |
---|
ClearButtonVisibilityMode |
Culture
Gets or sets the value of culture. Value of numeric text box can be displayed based on the Culture property.
Declaration
public CultureInfo Culture { get; set; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo | The default value is CultureInfo.CurrentUICulture |
EnableGroupSeparator
Gets or sets a value indicating whether the numeric text should be separated by separator or not.
Declaration
public bool EnableGroupSeparator { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Font
Gets or sets the value of Font. This property can be used to change the font of text in numeric text box.
Declaration
public Font Font { get; set; }
Property Value
Type |
---|
Xamarin.Forms.Font |
FontAttributes
Gets or sets the value of FontAttributes. This property can be used to change the value of numeric text box to either bold or italic.
Declaration
public FontAttributes FontAttributes { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.FontAttributes | The default value is Gray |
FontFamily
Gets or sets the value of FontFamily. This property can be used to change the FontFamily of text in numeric text box.
Declaration
public string FontFamily { get; set; }
Property Value
Type |
---|
System.String |
FontSize
Gets or sets the value of font size. This property can be used to customize the size of text in numeric text box.
Declaration
public double FontSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 18 |
FormatString
Gets or sets the value of FormatString. It determines the display format of the text when the control is unfocused.
Declaration
public string FormatString { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is 'n' |
GroupSeparatorMode
Gets or sets the value of GroupSeparatorMode. It is used to change the group separator active mode. By default it is LostFocus.
Declaration
public GroupSeparatorMode GroupSeparatorMode { get; set; }
Property Value
Type |
---|
GroupSeparatorMode |
IsReadOnly
Gets or sets a value indicating whether user should be prevented from modifying the text. Default is false.
Declaration
public bool IsReadOnly { get; set; }
Property Value
Type |
---|
System.Boolean |
Maximum
Gets or sets the value of Maximum. It is used to set the maximum value in numeric text box. You cannot increase the value after this range.
Declaration
public object Maximum { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is null. |
MaximumNumberDecimalDigits
Gets or sets the value of MaximumNumberDecimalDigits. It determines the maximum number of decimal digits to be allowed in numeric text box.
Declaration
public int MaximumNumberDecimalDigits { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 2. |
Minimum
Gets or sets the value of Minimum. It is used to set the Minimum value in numeric text box. You cannot decrease the value after this range.
Declaration
public object Minimum { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is null. |
ParserMode
Gets or sets the value of ParserMode. It is used to change the type of ParseMode to either Decimal or Double.
Declaration
public Parsers ParserMode { get; set; }
Property Value
Type | Description |
---|---|
Parsers | The default value is Decimal. |
PercentDisplayMode
Gets or sets the percent display mode that parses the entered text as percentage in specified mode.
Declaration
public PercentDisplayMode PercentDisplayMode { get; set; }
Property Value
Type | Description |
---|---|
PercentDisplayMode | The default value is Compute. |
ReturnCommand
Gets or sets the command to run when the user presses the return key.
Declaration
public ICommand ReturnCommand { get; set; }
Property Value
Type |
---|
System.Windows.Input.ICommand |
ReturnCommandParameter
Gets or sets the parameter for the ReturnCommand.
Declaration
public object ReturnCommandParameter { get; set; }
Property Value
Type |
---|
System.Object |
ReturnType
Gets or sets an enumeration value that controls the appearance of the return button.
Declaration
public ReturnType ReturnType { get; set; }
Property Value
Type |
---|
Xamarin.Forms.ReturnType |
SelectAllOnFocus
Gets or sets a value indicating whether the text of numeric text box is select all in focus state or not.
Declaration
public bool SelectAllOnFocus { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | default value is false. |
TextAlignment
Gets or sets the value of TextAlignment. It is used to set the alignment of the text in the input field.
Declaration
public TextAlignment TextAlignment { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.TextAlignment | The default value is Xamarin.Forms.TextAlignment.Start. |
TextColor
Gets or sets the value of TextColor. This property can be used to change the color of text in numeric text box.
Declaration
public Color TextColor { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Color | The default value is Gray |
Value
Gets or sets the value. This API is used to give input to numeric text box. It is text of numeric text box.
Declaration
public object Value { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is null. |
ValueChangeMode
Gets or sets the value change mode in which entered text is parsed to set to Value.
Declaration
public ValueChangeMode ValueChangeMode { get; set; }
Property Value
Type | Description |
---|---|
ValueChangeMode | The default value is OnLostFocus. |
Watermark
Gets or sets the value of Watermark. It is used to display hint text when the input field is empty and unfocused.
Declaration
public string Watermark { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is empty string. |
WatermarkColor
Gets or sets the value of WatermarkColor. This property can be used to change the color of watermark text in numeric text box.
Declaration
public Color WatermarkColor { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Color | The default value is Gray |
Methods
add_FocusChanged(SfNumericTextBox.FocusEventHandler)
Declaration
public void add_FocusChanged(SfNumericTextBox.FocusEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SfNumericTextBox.FocusEventHandler | value |
add_ValueChanged(SfNumericTextBox.ValueEventHandler)
Declaration
public void add_ValueChanged(SfNumericTextBox.ValueEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SfNumericTextBox.ValueEventHandler | value |
remove_FocusChanged(SfNumericTextBox.FocusEventHandler)
Declaration
public void remove_FocusChanged(SfNumericTextBox.FocusEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SfNumericTextBox.FocusEventHandler | value |
remove_ValueChanged(SfNumericTextBox.ValueEventHandler)
Declaration
public void remove_ValueChanged(SfNumericTextBox.ValueEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SfNumericTextBox.ValueEventHandler | value |
Events
Completed
This event occurs when Value is completed.
Declaration
public event EventHandler Completed
Event Type
Type |
---|
System.EventHandler |
FocusChanged
This event occurs when
Declaration
public event SfNumericTextBox.FocusEventHandler FocusChanged
Event Type
Type |
---|
SfNumericTextBox.FocusEventHandler |
ValueChanged
This event occurs when Value is changed.
Declaration
public event SfNumericTextBox.ValueEventHandler ValueChanged
Event Type
Type |
---|
SfNumericTextBox.ValueEventHandler |