menu

MAUI Toolkit

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

    Show / Hide Table of Contents

    Class SfNumericUpDown

    The SfNumericUpDown class allows users to adjust numeric values using increment and decrement buttons or by direct input. It supports value range constraints, step size, and culture-specific formatting.

    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
    SfNumericEntry.AllowNull
    SfNumericEntry.AllowNullProperty
    SfNumericEntry.ArrangeContent(Rect)
    SfNumericEntry.ClearButtonColor
    SfNumericEntry.ClearButtonColorProperty
    SfNumericEntry.ClearButtonPath
    SfNumericEntry.ClearButtonPathProperty
    SfNumericEntry.Completed
    SfNumericEntry.Culture
    SfNumericEntry.CultureProperty
    SfNumericEntry.CursorPosition
    SfNumericEntry.CursorPositionProperty
    SfNumericEntry.CustomFormat
    SfNumericEntry.CustomFormatProperty
    SfNumericEntry.EntryVisibilityProperty
    SfNumericEntry.Finalize()
    SfNumericEntry.Focus()
    SfNumericEntry.Focused
    SfNumericEntry.Font
    SfNumericEntry.FontAttributes
    SfNumericEntry.FontAttributesProperty
    SfNumericEntry.FontAutoScalingEnabled
    SfNumericEntry.FontAutoScalingEnabledProperty
    SfNumericEntry.FontFamily
    SfNumericEntry.FontFamilyProperty
    SfNumericEntry.FontSize
    SfNumericEntry.FontSizeProperty
    SfNumericEntry.HorizontalTextAlignment
    SfNumericEntry.HorizontalTextAlignmentProperty
    SfNumericEntry.IsEditable
    SfNumericEntry.IsEditableProperty
    SfNumericEntry.Maximum
    SfNumericEntry.MaximumNumberDecimalDigits
    SfNumericEntry.MaximumNumberDecimalDigitsProperty
    SfNumericEntry.MaximumProperty
    SfNumericEntry.Minimum
    SfNumericEntry.MinimumProperty
    SfNumericEntry.OnDraw(ICanvas, RectF)
    SfNumericEntry.OnFontChanged(Font, Font)
    SfNumericEntry.OnGotFocus()
    SfNumericEntry.OnHandlerChanged()
    SfNumericEntry.OnLostFocus()
    SfNumericEntry.OnPropertyChanged(String)
    SfNumericEntry.PercentDisplayMode
    SfNumericEntry.PercentDisplayModeProperty
    SfNumericEntry.Placeholder
    SfNumericEntry.PlaceholderColor
    SfNumericEntry.PlaceholderColorProperty
    SfNumericEntry.PlaceholderProperty
    SfNumericEntry.ReturnCommand
    SfNumericEntry.ReturnCommandParameter
    SfNumericEntry.ReturnCommandParameterProperty
    SfNumericEntry.ReturnCommandProperty
    SfNumericEntry.ReturnType
    SfNumericEntry.ReturnTypeProperty
    SfNumericEntry.SelectionLength
    SfNumericEntry.SelectionLengthProperty
    SfNumericEntry.ShowBorder
    SfNumericEntry.ShowBorderProperty
    SfNumericEntry.ShowClearButton
    SfNumericEntry.ShowClearButtonProperty
    SfNumericEntry.Stroke
    SfNumericEntry.StrokeProperty
    SfNumericEntry.TextColor
    SfNumericEntry.TextColorProperty
    SfNumericEntry.Unfocus()
    SfNumericEntry.Unfocused
    SfNumericEntry.Value
    SfNumericEntry.ValueChanged
    SfNumericEntry.ValueChangeMode
    SfNumericEntry.ValueChangeModeProperty
    SfNumericEntry.ValueProperty
    SfNumericEntry.VerticalTextAlignment
    SfNumericEntry.VerticalTextAlignmentProperty
    SfView.Children
    SfView.ClipToBounds
    SfView.Padding
    Namespace: Syncfusion.Maui.Toolkit.NumericUpDown
    Assembly: Syncfusion.Maui.Toolkit.dll
    Syntax
    public class SfNumericUpDown : SfNumericEntry, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, ITextElement, ITouchListener, IKeyboardListener, ITextInputLayout, IParentThemeElement, IThemeElement
    Examples

    The below example demonstrates how to initialize the SfNumericUpDown.

    • XAML
    • C#
    <numeric:SfNumericUpDown
          x:Name="numericUpDown"
          Value="10"
          Minimum="0"
          Maximum="100"
          WidthRequest="200"/>
    SfNumericUpDown numericUpDown = new SfNumericUpDown();
    numericUpDown.Value = 10;
    numericUpDown.Minimum = 0;
    numericUpDown.Maximum = 100;
    numericUpDown.WidthRequest = 200;

    Constructors

    SfNumericUpDown()

    Initializes a new instance of the SfNumericUpDown class. This control allows users to select a numeric value using up and down buttons.

    Declaration
    public SfNumericUpDown()

    Fields

    AutoReverseProperty

    Identifies AutoReverse dependency property.

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

    The identifier for the AutoReverse bindable property.

    DownButtonTemplateProperty

    Identifies DownButtonTemplate bindable property.

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

    The identifier for the DownButtonTemplate bindable property.

    LargeChangeProperty

    Identifies LargeChange dependency property.

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

    The identifier for the LargeChange bindable property.

    SmallChangeProperty

    Identifies SmallChange dependency property.

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

    The identifier for the SmallChange bindable property.

    UpButtonTemplateProperty

    Identifies UpButtonTemplateProperty bindable property.

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

    The identifier for the UpButtonTemplate bindable property.

    UpDownButtonAlignmentProperty

    Identifies the UpDownButtonAlignment bindable property.

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

    UpDownButtonColorProperty

    Identifies UpDownButtonColor bindable property.

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

    The identifier for the UpDownButtonColor bindable property.

    UpDownPlacementModeProperty

    Identifies UpDownPlacementMode dependency property.

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

    The identifier for the UpDownPlacementMode bindable property.

    Properties

    AutoReverse

    Gets or sets a value indicating whether to enable or disable the cyclic behavior when the value reaches the minimum or maximum value.

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

    The default value is false.

    Examples

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

    • XAML
    • C#
    <numericUpDown:NumericUpDown
        x:Name="numericUpDown"
        AutoReverse="True" />
    NumericUpDown numericUpDown = new NumericUpDown();
    numericUpDown.AutoReverse = true;
    this.Content = numericUpDown;

    DownButtonTemplate

    Gets or sets a Data template for down button.

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

    The default value is null.

    Examples

    Below is an example of how to define a custom template for the down button:

    • XAML
    • C#
    <numericUpDown:SfNumericUpDown x:Name="numericUpDown">
        <numericUpDown:SfNumericUpDown.DownButtonTemplate>
            <DataTemplate>
                <Grid>
                    <Label 
                        Text="-" 
                        HorizontalOptions="Center" 
                        VerticalOptions="Center"
                        FontSize="16" 
                        FontAttributes="Bold" />
                </Grid>
            </DataTemplate>
        </numericUpDown:SfNumericUpDown.DownButtonTemplate>
    </numericUpDown:NumericUpDown>
    SfNumericUpDown numericUpDown = new SfNumericUpDown();
    numericUpDown.DownButtonTemplate = new DataTemplate(() =>
    {
        Grid grid = new Grid();
        Label label = new Label
        {
            Text = "-",
            HorizontalOptions = LayoutOptions.Center,
            VerticalOptions = LayoutOptions.Center,
            FontSize = 16,
            FontAttributes = FontAttributes.Bold
        };
        grid.Children.Add(label);
        return grid;
    });

    LargeChange

    Gets or sets the value that is added to or subtracted from Value when a large change is made, such as with the PageUP and PageDown keys.

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

    The default value is 10.

    Examples

    To set a large change value of 5 in XAML:

    <numericUpDown:SfNumericUpDown
        x:Name="numericUpDown"
        LargeChange="5" />

    To set a large change value of 5 in C#:

    SfNumericUpDown numericUpDown = new SfNumericUpDown();
    numericUpDown.LargeChange = 5;
    this.Content = numericUpDown;

    SmallChange

    Gets or sets the value that is added to or subtracted from Value when a small change is made, such as with an arrow key or scrolling.

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

    The default value is 1.

    Examples

    To set a small change value of 0.1 in XAML:

    <numericUpDown:SfNumericUpDown
        x:Name="numericUpDown"
        SmallChange="0.1" />

    To set a small change value of 0.1 in C#:

    SfNumericUpDown numericUpDown = new SfNumericUpDown();
    numericUpDown.SmallChange = 0.1;
    this.Content = numericUpDown;

    UpButtonTemplate

    Gets or sets a Data template for up button.

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

    The default value is null.

    Examples

    Below is an example of how to define a custom template for the up button:

    • XAML
    • C#
    <numericUpDown:SfNumericUpDown x:Name="numericUpDown">
        <numericUpDown:SfNumericUpDown.UpButtonTemplate>
            <DataTemplate>
                <Grid>
                    <Label 
                        Text="+" 
                        HorizontalOptions="Center" 
                        VerticalOptions="Center"
                        FontSize="16" 
                        FontAttributes="Bold" />
                </Grid>
            </DataTemplate>
        </numericUpDown:SfNumericUpDown.UpButtonTemplate>
    </numericUpDown:SfNumericUpDown>
    SfNumericUpDown numericUpDown = new SfNumericUpDown();
    numericUpDown.UpButtonTemplate = new DataTemplate(() =>
    {
        Grid grid = new Grid();
        Label label = new Label
        {
            Text = "+",
            HorizontalOptions = LayoutOptions.Center,
            VerticalOptions = LayoutOptions.Center,
            FontSize = 16,
            FontAttributes = FontAttributes.Bold
        };
        grid.Children.Add(label);
        return grid;
    });

    UpDownButtonAlignment

    Gets or sets the alignment of the buttons used to align increment or decrement the Value property.

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

    The default value is Right.

    Remarks

    In InlineVertical mode, if UpDownButtonAlignment is set to Both. The "UpDown" buttons is aligned to the right side.

    Examples

    To set a large change value of 5 in XAML:

    <numericUpDown:SfNumericUpDown
        x:Name="numericUpDown"
        UpDownButtonAlignment="Both" />

    To set a large change value of 5 in C#:

    SfNumericUpDown numericUpDown = new SfNumericUpDown();
    numericUpDown.UpDownButtonAlignment = UpDownButtonAlignment.Both;
    this.Content = numericUpDown;

    UpDownButtonColor

    Gets or sets the color of the up and down buttons in the Syncfusion.Maui.Toolkit.NumericUpDown control.

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

    The default value is Microsoft.Maui.Graphics.Colors.Black.

    Examples

    To set the up and down button color to blue in XAML:

    <numericUpDown:SfNumericUpDown
        x:Name="numericUpDown"
        UpDownButtonColor="Blue" />

    To set the up and down button color to blue in C#:

    SfNumericUpDown numericUpDown = new SfNumericUpDown();
    numericUpDown.UpDownButtonColor = Colors.Blue;
    this.Content = numericUpDown;

    UpDownPlacementMode

    Gets or sets a value that indicates the placement of buttons used to increment or decrement the Value property.

    Declaration
    public NumericUpDownPlacementMode UpDownPlacementMode { get; set; }
    Property Value
    Type Description
    NumericUpDownPlacementMode

    The default value is Inline.

    Examples

    To set the spin buttons to vertical in XAML:

    <numericUpDown:SfNumericUpDown
        x:Name="numericUpDown"
        UpDownPlacementMode="InlineVertical" />

    To set the spin buttons to vertical in C#:

    SfNumericUpDown numericUpDown = new SfNumericUpDown();
    numericUpDown.UpDownPlacementMode = NumericUpDownPlacementMode.InlineVertical;
    this.Content = numericUpDown;

    Methods

    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
    SfNumericEntry.GetSemanticsNodesCore(Double, 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
    SfNumericEntry.MeasureContent(Double, Double)

    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()
    Overrides
    SfNumericEntry.OnParentChanged()

    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 override 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.

    Overrides
    SfNumericEntry.TextBox_HandlerChanged(Object, EventArgs)

    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