menu

MAUI Toolkit

  • User Guide
  • Demos
  • Support
Class SfNumericEntry - MAUI-ToolKit API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfNumericEntry

    Represents a control that can be used to display and edit numbers.

    Inheritance
    System.Object
    SfView
    SfNumericEntry
    SfNumericUpDown
    Implements
    IDrawableLayout
    Microsoft.Maui.Graphics.IDrawable
    Microsoft.Maui.IAbsoluteLayout
    Microsoft.Maui.ILayout
    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Microsoft.Maui.IContainer
    System.Collections.Generic.IList<Microsoft.Maui.IView>
    System.Collections.Generic.ICollection<Microsoft.Maui.IView>
    System.Collections.Generic.IEnumerable<Microsoft.Maui.IView>
    System.Collections.IEnumerable
    Microsoft.Maui.ISafeAreaView
    Microsoft.Maui.IPadding
    Microsoft.Maui.ICrossPlatformLayout
    Microsoft.Maui.IVisualTreeElement
    Inherited Members
    SfView.Children
    SfView.ClipToBounds
    SfView.Padding
    Namespace: Syncfusion.Maui.Toolkit.NumericEntry
    Assembly: Syncfusion.Maui.Toolkit.dll
    Syntax
    public class SfNumericEntry : SfView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, ITextElement, ITouchListener, IKeyboardListener, IParentThemeElement, IThemeElement, ITextInputLayout
    Examples
    <numeric:SfNumericEntry Placeholder = "Enter your age"
                            Value="12" />

    The below example demonstrates how to initialize the SfNumericEntry.

    • XAML
    • C#
    <numeric:SfNumericEntry
          x:Name="numericEntry"
          Value="123"
          Minimum="0"
          Maximum="1000"
          WidthRequest="200"/>
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.Value = 123;
    numericEntry.Minimum = 0;
    numericEntry.Maximum = 1000;
    numericEntry.WidthRequest = 200;

    Constructors

    SfNumericEntry()

    Initializes a new instance of the SfNumericEntry class.

    Declaration
    public SfNumericEntry()

    SfNumericEntry(Boolean)

    Initializes a new instance of the SfNumericEntry class.

    Declaration
    public SfNumericEntry(bool isInternallyCreated)
    Parameters
    Type Name Description
    System.Boolean isInternallyCreated

    To indicate internally created for SfNumericUpDown.

    Fields

    AllowNullProperty

    Identifies AllowNull dependency property.

    Declaration
    public static readonly BindableProperty AllowNullProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the AllowNull dependency property.

    ClearButtonColorProperty

    Identifies ClearButtonColor bindable property.

    Declaration
    public static readonly BindableProperty ClearButtonColorProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ClearButtonColor bindable property.

    ClearButtonPathProperty

    Identifies the ClearButtonPath bindable property. This property can be used to Customize the clear button of NumericEntry control.

    Declaration
    public static readonly BindableProperty ClearButtonPathProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ClearButtonPath bindable property.

    CultureProperty

    Identifies Culture dependency property.

    Declaration
    public static readonly BindableProperty CultureProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the Culture dependency property.

    CursorPositionProperty

    Identifies CursorPosition dependency property.

    Declaration
    public static readonly BindableProperty CursorPositionProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the CursorPosition bindable property.

    CustomFormatProperty

    Identifies CustomFormat dependency property.

    Declaration
    public static readonly BindableProperty CustomFormatProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the CustomFormat bindable property.

    EntryVisibilityProperty

    Identifies Syncfusion.Maui.Toolkit.NumericEntry.SfNumericEntry.EntryVisibility dependency property.

    Declaration
    public static readonly BindableProperty EntryVisibilityProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the Syncfusion.Maui.Toolkit.NumericEntry.SfNumericEntry.EntryVisibility dependency property.

    FontAttributesProperty

    Identifies the FontAttributes bindable property.

    Declaration
    public static readonly BindableProperty FontAttributesProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for FontAttributes bindable property.

    FontAutoScalingEnabledProperty

    Identifies the FontAutoScalingEnabled bindable property.

    Declaration
    public static readonly BindableProperty FontAutoScalingEnabledProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for FontAutoScalingEnabled bindable property.

    FontFamilyProperty

    Identifies the FontFamily bindable property.

    Declaration
    public static readonly BindableProperty FontFamilyProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for FontFamily bindable property.

    FontSizeProperty

    Identifies the FontSize bindable property.

    Declaration
    public static readonly BindableProperty FontSizeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for FontSize bindable property.

    HorizontalTextAlignmentProperty

    Identifies HorizontalTextAlignment dependency property.

    Declaration
    public static readonly BindableProperty HorizontalTextAlignmentProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the HorizontalTextAlignment bindable property.

    IsEditableProperty

    Identifies IsEditable dependency property.

    Declaration
    public static readonly BindableProperty IsEditableProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the IsEditable dependency property.

    MaximumNumberDecimalDigitsProperty

    Identifies MaximumNumberDecimalDigits dependency property.

    Declaration
    public static readonly BindableProperty MaximumNumberDecimalDigitsProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the MaximumNumberDecimalDigits bindable property.

    MaximumProperty

    Identifies Maximum dependency property.

    Declaration
    public static readonly BindableProperty MaximumProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the Maximum bindable property.

    MinimumProperty

    Identifies Minimum dependency property.

    Declaration
    public static readonly BindableProperty MinimumProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the Minimum bindable property.

    PercentDisplayModeProperty

    Identifies PercentDisplayMode dependency property.

    Declaration
    public static readonly BindableProperty PercentDisplayModeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the PercentDisplayMode dependency property.

    PlaceholderColorProperty

    Identifies PlaceholderColor bindable property.

    Declaration
    public static readonly BindableProperty PlaceholderColorProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the PlaceholderColor bindable property.

    PlaceholderProperty

    Identifies Placeholder dependency property.

    Declaration
    public static readonly BindableProperty PlaceholderProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the Placeholder bindable property.

    ReturnCommandParameterProperty

    Identifies the ReturnCommandParameter bindable property. ReturnCommandParameter is a type of object and it specifies the parameter for the ReturnCommand.

    Declaration
    public static readonly BindableProperty ReturnCommandParameterProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ReturnCommandParameter bindable property.

    ReturnCommandProperty

    Identifies the ReturnCommand bindable property.The return command will trigger whenever the return key is pressed. The default value is null.

    Declaration
    public static readonly BindableProperty ReturnCommandProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ReturnCommand bindable property.

    ReturnTypeProperty

    Identifies the ReturnType bindable property. This property can be used to change the ReturnType.

    Declaration
    public static readonly BindableProperty ReturnTypeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ReturnType bindable property.

    SelectionLengthProperty

    Identifies SelectionLength dependency property.

    Declaration
    public static readonly BindableProperty SelectionLengthProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the SelectionLength bindable property.

    ShowBorderProperty

    Identifies ShowBorder dependency property.

    Declaration
    public static readonly BindableProperty ShowBorderProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ShowBorder dependency property.

    ShowClearButtonProperty

    Identifies ShowClearButton dependency property.

    Declaration
    public static readonly BindableProperty ShowClearButtonProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ShowClearButton dependency property.

    StrokeProperty

    Identifies Stroke bindable property.

    Declaration
    public static readonly BindableProperty StrokeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the Stroke bindable property.

    TextColorProperty

    Identifies the TextColor bindable property.

    Declaration
    public static readonly BindableProperty TextColorProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for TextColor bindable property.

    ValueChangeModeProperty

    Identifies ValueChangeMode dependency property.

    Declaration
    public static readonly BindableProperty ValueChangeModeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ValueChangeMode bindable property.

    ValueProperty

    Identifies Value dependency property.

    Declaration
    public static readonly BindableProperty ValueProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the Value bindable property.

    VerticalTextAlignmentProperty

    Identifies VerticalTextAlignment dependency property.

    Declaration
    public static readonly BindableProperty VerticalTextAlignmentProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the VerticalTextAlignment bindable property.

    Properties

    AllowNull

    Gets or sets a value indicating whether the SfNumericEntry allows null value or not.

    Declaration
    public bool AllowNull { get; set; }
    Property Value
    Type Description
    System.Boolean

    true when SfNumericEntry allows null value input, otherwise false. The default value is true.

    Examples

    Below is an example of how to configure the AllowNull property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        AllowNull="True" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.AllowNull = true;
    this.Content = numericEntry;

    ClearButtonColor

    Gets or sets a color that describes the color of clear button.

    Declaration
    public Color ClearButtonColor { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Graphics.Color

    The default value is Colors.Black.

    Examples

    Below is an example of how to configure the ClearButtonColor property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        ClearButtonColor="Red" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.ClearButtonColor = Colors.Red;
    this.Content = numericEntry;

    ClearButtonPath

    Gets or sets the path to customize the appearance of the clear button in the NumericEntry control.

    Declaration
    public Path ClearButtonPath { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.Shapes.Path

    The default value is null.

    Examples

    Below is an example of how to configure the ClearButtonPath property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        ClearButtonPath="M10,10 L20,20 L30,10" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.ClearButtonPath = "M10,10 L20,20 L30,10";
    this.Content = numericEntry;

    Culture

    Gets or sets the culture for SfNumericEntry.

    Declaration
    public CultureInfo Culture { get; set; }
    Property Value
    Type Description
    System.Globalization.CultureInfo

    The default value is "en-US".

    Examples

    Below is an example of how to configure the Culture property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        Culture="fr-FR" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.Culture = new System.Globalization.CultureInfo("fr-FR");
    this.Content = numericEntry;

    CursorPosition

    Gets or sets the cursor position of the SfNumericEntry control.

    Declaration
    public int CursorPosition { get; set; }
    Property Value
    Type Description
    System.Int32

    The default value is 0.

    Examples

    Below is an example of how to configure the CursorPosition property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        CursorPosition="5" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.CursorPosition = 5;
    this.Content = numericEntry;

    CustomFormat

    Gets or sets the format used to specify the formatting of Value.

    Declaration
    public string CustomFormat { get; set; }
    Property Value
    Type Description
    System.String

    The default value is null.

    Examples

    Below is an example of how to configure the CustomFormat property using XAML and C#:

    • XAML
    • C#
    <editor:SfNumericEntry
        x:Name="editor"
        CustomFormatter="#.# dollars" />
    SfNumericEntry editor = new SfNumericEntry();
    editor.CustomFormatter = "#.# dollars";
    this.Content = editor;

    To display a minimum of 2 decimal digits and maximum of 4 digits, with grouping:

    editor.CustomFormatter = "#,0.00##";

    To remove group separator:

    editor.CustomFormatter = "#,#.#";

    To display currency format:

    editor.CustomFormatter = "C";

    To display percentage format, with a minimum of 2 decimal digits:

    editor.CustomFormatter = "#.#%";

    Font

    Gets or sets the font for the text of SfNumericEntry.

    Declaration
    public Font Font { get; }
    Property Value
    Type
    Microsoft.Maui.Font

    FontAttributes

    Gets or sets the value that indicates whether the font for the NumericEntry text is bold,italic, or neither.

    Declaration
    public FontAttributes FontAttributes { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.FontAttributes

    Specifies the font attributes.The default value is Microsoft.Maui.Controls.FontAttributes.None

    Examples

    Below is an example of how to configure the FontAttributes property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        FontAttributes="Bold" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.FontAttributes = FontAttributes.Bold;
    this.Content = numericEntry;

    FontAutoScalingEnabled

    Enables automatic font size adjustment based on device settings.

    Declaration
    public bool FontAutoScalingEnabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    The default value is false.

    Examples

    Below is an example of how to configure the FontAutoScalingEnabled property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        FontAutoScalingEnabled="True" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.FontAutoScalingEnabled = true;
    this.Content = numericEntry;

    FontFamily

    Gets or sets the font family for the text of SfNumericEntry.

    Declaration
    public string FontFamily { get; set; }
    Property Value
    Type Description
    System.String

    Specifies the font family.The default value is string.empty.

    Examples

    Below is an example of how to configure the FontFamily property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        FontFamily="Arial" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.FontFamily = "Arial";
    this.Content = numericEntry;

    FontSize

    Gets or sets the value of FontSize. This property can be used to the size of the font for SfNumericEntry.

    Declaration
    public double FontSize { get; set; }
    Property Value
    Type Description
    System.Double

    Specifies the font size.The default value is 14d.

    Examples

    Below is an example of how to configure the FontSize property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        FontSize="18" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.FontSize = 18;
    this.Content = numericEntry;

    HorizontalTextAlignment

    Gets or sets a value to change the horizontal alignment of text within the NumericEntry control.

    Declaration
    public TextAlignment HorizontalTextAlignment { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.TextAlignment

    Specifies the text alignment.The default value is Microsoft.Maui.TextAlignment.Start.

    Examples

    Below is an example of how to configure the HorizontalTextAlignment property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        HorizontalTextAlignment="Center" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.HorizontalTextAlignment = TextAlignment.Center;
    this.Content = numericEntry;

    IsEditable

    Gets or sets a value indicating whether the SfNumericEntry allows editing the value or not.

    Declaration
    public bool IsEditable { get; set; }
    Property Value
    Type Description
    System.Boolean

    true when SfNumericEntry is editable, otherwise false. The default value is true.

    Examples

    Below is an example of how to configure the IsEditable property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        IsEditable="False" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.IsEditable = false;
    this.Content = numericEntry;

    Maximum

    Gets or sets the numerical maximum for Value.

    Declaration
    public double Maximum { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is System.Double.MaxValue.

    Examples

    Below is an example of how to configure the Maximum property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        Maximum="100" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.Maximum = 100;
    this.Content = numericEntry;

    MaximumNumberDecimalDigits

    Gets or sets the maximum number of decimal digits allowed in the numeric input.

    Declaration
    public int MaximumNumberDecimalDigits { get; set; }
    Property Value
    Type Description
    System.Int32

    The default value is 2.

    Examples

    Below is an example of how to configure the MaximumNumberDecimalDigits property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        MaximumNumberDecimalDigits="1" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.MaximumNumberDecimalDigits = 1;
    this.Content = numericEntry;

    Minimum

    Gets or sets the numerical minimum for Value.

    Declaration
    public double Minimum { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is System.Double.MinValue

    Examples

    Below is an example of how to configure the Minimum property using XAML and C#:

    • XAML
    • C#
    <numericEntry:NumericEntry
        x:Name="numericEntry"
        Minimum="10" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.Minimum = 10;
    this.Content = numericEntry;

    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.

    Remarks

    This property does not work when a CustomFormat is applied to the control. In such cases, the custom format takes precedence, and the percentage display mode is ignored.

    Examples

    Below is an example of how to configure the PercentDisplayMode property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        PercentDisplayMode="Value" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.PercentDisplayMode = PercentDisplayMode.Value;
    this.Content = numericEntry;

    Placeholder

    Gets or sets the text that is displayed in the control until the value is changed by a user action or some other operation.

    Declaration
    public string Placeholder { get; set; }
    Property Value
    Type Description
    System.String

    The default value is String.Empty

    Examples

    Below is an example of how to configure the Placeholder property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        Placeholder="Enter a value" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.Placeholder = "Enter a value";
    this.Content = numericEntry;

    PlaceholderColor

    Gets or sets a color that describes the color of placeholder text.

    Declaration
    public Color PlaceholderColor { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Graphics.Color

    The default value is Colors.Black.

    Examples

    Below is an example of how to configure the PlaceholderColor property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        Placeholder="Enter a value"
        PlaceholderColor="Red" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.Placeholder = "Enter a value";
    numericEntry.PlaceholderColor = Colors.Red;
    this.Content = numericEntry;

    ReturnCommand

    Gets or sets the ReturnCommand to run when the user presses the return key, either physically or on the on-screen keyboard.

    Declaration
    public ICommand ReturnCommand { get; set; }
    Property Value
    Type Description
    System.Windows.Input.ICommand

    Specifies the ReturnCommand. The default value is null.

    Examples

    Below is an example of how to configure the ReturnCommand property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        ReturnCommand="{Binding OnReturnCommand}" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.ReturnCommand = new Command(() => Console.WriteLine("Return pressed"));
    this.Content = numericEntry;

    ReturnCommandParameter

    Gets or sets the parameter object for the ReturnCommand that can be used to provide extra information.

    Declaration
    public object ReturnCommandParameter { get; set; }
    Property Value
    Type Description
    System.Object

    The default value is null

    Examples

    Below is an example of how to configure the ReturnCommandParameter property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        ReturnCommand="{Binding OnReturnCommand}"
        ReturnCommandParameter="Numeric Entry Data" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.ReturnCommand = new Command((param) => Console.WriteLine($"Return pressed with: {param}"));
    numericEntry.ReturnCommandParameter = "Numeric Entry Data";
    this.Content = numericEntry;

    ReturnType

    Gets or sets the value of ReturnType. This property can be used to set the ReturnType.

    Declaration
    public ReturnType ReturnType { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.ReturnType

    The default value is Default

    Examples

    Below is an example of how to configure the ReturnType property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        ReturnType="Done" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.ReturnType = ReturnType.Done;
    this.Content = numericEntry;

    SelectionLength

    Gets or sets the selection length of the SfNumericEntry control.

    Declaration
    public int SelectionLength { get; set; }
    Property Value
    Type Description
    System.Int32

    The default value is 0.

    Examples

    Below is an example of how to configure the SelectionLength property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        SelectionLength="3" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.SelectionLength = 3;
    this.Content = numericEntry;

    ShowBorder

    Gets or sets a value indicating whether to show or hide the border in SfNumericEntry.

    Declaration
    public bool ShowBorder { get; set; }
    Property Value
    Type Description
    System.Boolean

    The default value is true

    Examples

    Below is an example of how to configure the ShowBorder property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        ShowBorder="False" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.ShowBorder = false;
    this.Content = numericEntry;

    ShowClearButton

    Gets or sets a value indicating whether to show or hide the clear button in SfNumericEntry.

    Declaration
    public bool ShowClearButton { get; set; }
    Property Value
    Type Description
    System.Boolean

    The default value is true.

    Examples

    Below is an example of how to configure the ShowClearButton property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        ShowClearButton="False" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.ShowClearButton = false;
    this.Content = numericEntry;

    Stroke

    Gets or sets a color that describes the stroke.

    Declaration
    public Brush Stroke { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.Brush

    The default value is Colors.LightGray

    Examples

    Below is an example of how to configure the Stroke property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        Stroke="LightGray" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.Stroke = Colors.LightGray;
    this.Content = numericEntry;

    TextColor

    Gets or sets the color for the text of the SfNumericEntry control.

    Declaration
    public Color TextColor { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Graphics.Color

    It accepts Microsoft.Maui.Graphics.Color values and the default value is Colors.Black.

    Examples

    Below is an example of how to configure the TextColor property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        TextColor="Blue" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.TextColor = Colors.Blue;
    this.Content = numericEntry;

    Value

    Gets or sets the numeric value of a SfNumericEntry.

    Declaration
    public Nullable<double> Value { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Double>

    The default value is null.

    Examples

    Below is an example of how to configure the Value property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        Value="123.45" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.Value = 123.45;
    this.Content = numericEntry;

    ValueChangeMode

    Gets or sets whether the value should be updated or not based on this property while entering the value.

    Declaration
    public ValueChangeMode ValueChangeMode { get; set; }
    Property Value
    Type Description
    ValueChangeMode

    The default value is OnLostFocus

    Examples

    Below is an example of how to configure the ValueChangeMode property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        ValueChangeMode="OnKeyFocus" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.ValueChangeMode = ValueChangeMode.OnKeyFocus;
    this.Content = numericEntry;

    VerticalTextAlignment

    Gets or sets a value to change the vertical alignment of text within the NumericEntry control.

    Declaration
    public TextAlignment VerticalTextAlignment { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.TextAlignment

    Specifies the text alignment.The default value is Microsoft.Maui.TextAlignment.Center.

    Examples

    Below is an example of how to configure the VerticalTextAlignment property using XAML and C#:

    • XAML
    • C#
    <numericEntry:SfNumericEntry
        x:Name="numericEntry"
        VerticalTextAlignment="Center" />
    SfNumericEntry numericEntry = new SfNumericEntry();
    numericEntry.VerticalTextAlignment = TextAlignment.Center;
    this.Content = numericEntry;

    Methods

    ArrangeContent(Rect)

    Arranges the content of the control within the specified bounds post-measurement.

    Declaration
    protected override Size ArrangeContent(Rect bounds)
    Parameters
    Type Name Description
    Microsoft.Maui.Graphics.Rect bounds

    The rectangle that defines the bounds available for the content arrangement.

    Returns
    Type Description
    Microsoft.Maui.Graphics.Size

    The actual size used by the arranged content, typically equal to the size of the bounds.

    Overrides
    Syncfusion.Maui.Toolkit.SfView.ArrangeContent(Microsoft.Maui.Graphics.Rect)

    Finalize()

    Destructor of the SfNumericEntry class.

    Declaration
    protected override void Finalize()

    Focus()

    Sets focus to the control, allowing user input.

    Declaration
    public void Focus()

    GetSemanticsNodesCore(Double, Double)

    Retrieves the list of semantics nodes for accessibility support, which represent how the control is perceived by assistive technologies.

    Declaration
    protected override List<SemanticsNode> GetSemanticsNodesCore(double width, double height)
    Parameters
    Type Name Description
    System.Double width

    The width constraint for the semantics nodes.

    System.Double height

    The height constraint for the semantics nodes.

    Returns
    Type Description
    System.Collections.Generic.List<Syncfusion.Maui.Toolkit.Graphics.Internals.SemanticsNode>

    A list of semantics nodes that describe the accessible elements within this control.

    Overrides
    Syncfusion.Maui.Toolkit.SfView.GetSemanticsNodesCore(System.Double, System.Double)

    MeasureContent(Double, Double)

    Measures the content of the control to determine the desired size based on the given constraints.

    Declaration
    protected override Size MeasureContent(double widthConstraint, double heightConstraint)
    Parameters
    Type Name Description
    System.Double widthConstraint

    The maximum width available for the content.

    System.Double heightConstraint

    The maximum height available for the content.

    Returns
    Type Description
    Microsoft.Maui.Graphics.Size

    The desired size for the content, which should be within the given constraints.

    Overrides
    Syncfusion.Maui.Toolkit.SfView.MeasureContent(System.Double, System.Double)

    OnDraw(ICanvas, RectF)

    Called during the render pass to draw the control's content onto the canvas.

    Declaration
    protected override void OnDraw(ICanvas canvas, RectF dirtyRect)
    Parameters
    Type Name Description
    Microsoft.Maui.Graphics.ICanvas canvas

    The canvas to draw on, providing methods and properties for rendering.

    Microsoft.Maui.Graphics.RectF dirtyRect

    The rectangle area that needs to be redrawn, typically due to invalidation.

    Overrides
    Syncfusion.Maui.Toolkit.SfView.OnDraw(Microsoft.Maui.Graphics.ICanvas, Microsoft.Maui.Graphics.RectF)

    OnFontChanged(Font, Font)

    Called when the font is changed.

    Declaration
    public void OnFontChanged(Font oldValue, Font newValue)
    Parameters
    Type Name Description
    Microsoft.Maui.Font oldValue

    The old font value.

    Microsoft.Maui.Font newValue

    The new font value.

    OnGotFocus()

    Called when the numeric entry receives focus.

    Declaration
    protected void OnGotFocus()

    OnHandlerChanged()

    Declaration
    protected override void OnHandlerChanged()
    Overrides
    Syncfusion.Maui.Toolkit.SfView.OnHandlerChanged()

    OnLostFocus()

    Called when the numeric entry loses focus.

    Declaration
    protected void OnLostFocus()

    OnParentChanged()

    Method called when the control's parent changes, allowing for adjustments related to the change in hierarchy or parent container.

    Declaration
    protected override void OnParentChanged()

    OnPropertyChanged(String)

    Called when a property value changes. This method is used to react to property updates, typically for updating UI or state.

    Declaration
    protected override void OnPropertyChanged(string propertyName = null)
    Parameters
    Type Name Description
    System.String propertyName

    The name of the property that changed. By default, this is automatically provided by the caller.

    TextBox_HandlerChanged(Object, EventArgs)

    Handles changes to the TextBox control in a .NET MAUI application. This method is triggered whenever the TextBox's state changes, allowing for custom behavior in response to those changes.

    Declaration
    protected virtual void TextBox_HandlerChanged(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender

    The source of the event, typically the TextBox.

    System.EventArgs e

    Event arguments containing data related to the change event.

    Unfocus()

    Removes focus from the control, disabling user input.

    Declaration
    public void Unfocus()

    Events

    Completed

    Occurs when the user finalizes the text in an numeric entry with the return key.

    Declaration
    public event EventHandler Completed
    Event Type
    Type
    System.EventHandler

    Focused

    Occurs when the control get focused.

    Declaration
    public event EventHandler<FocusEventArgs> Focused
    Event Type
    Type
    System.EventHandler<Microsoft.Maui.Controls.FocusEventArgs>

    Unfocused

    Occurs when the control get unfocused.

    Declaration
    public event EventHandler<FocusEventArgs> Unfocused
    Event Type
    Type
    System.EventHandler<Microsoft.Maui.Controls.FocusEventArgs>

    ValueChanged

    Occurs after the user triggers evaluation of new input by pressing the Enter key, clicking a spin button, or by changing focus.

    Declaration
    public event EventHandler<NumericEntryValueChangedEventArgs> ValueChanged
    Event Type
    Type
    System.EventHandler<NumericEntryValueChangedEventArgs>

    Implements

    IDrawableLayout
    Microsoft.Maui.Graphics.IDrawable
    Microsoft.Maui.IAbsoluteLayout
    Microsoft.Maui.ILayout
    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Microsoft.Maui.IContainer
    System.Collections.Generic.IList<>
    System.Collections.Generic.ICollection<>
    System.Collections.Generic.IEnumerable<>
    System.Collections.IEnumerable
    Microsoft.Maui.ISafeAreaView
    Microsoft.Maui.IPadding
    Microsoft.Maui.ICrossPlatformLayout
    Microsoft.Maui.IVisualTreeElement
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved