menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DataFormNumericItem - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DataFormNumericItem

    Represents the class that encapsulates the layout and numeric editor(SfNumericEntry) settings for data field.

    Inheritance
    System.Object
    DataFormViewItem
    DataFormItem
    DataFormTextEditorItem
    DataFormNumericItem
    Inherited Members
    DataFormItem.Background
    DataFormItem.BackgroundProperty
    DataFormItem.DefaultLayoutSettings
    DataFormItem.DefaultLayoutSettingsProperty
    DataFormItem.EditorHeight
    DataFormItem.EditorHeightProperty
    DataFormItem.EditorTextStyle
    DataFormItem.EditorTextStyleProperty
    DataFormItem.ErrorLabelTextStyle
    DataFormItem.ErrorLabelTextStyleProperty
    DataFormItem.FieldName
    DataFormItem.FieldNameProperty
    DataFormItem.GetValue()
    DataFormItem.GroupName
    DataFormItem.GroupNameProperty
    DataFormItem.IsReadOnly
    DataFormItem.IsReadOnlyProperty
    DataFormItem.IsValid
    DataFormItem.ItemsOrderInRow
    DataFormItem.ItemsOrderInRowProperty
    DataFormItem.LabelText
    DataFormItem.LabelTextProperty
    DataFormItem.LabelTextStyle
    DataFormItem.LabelTextStyleProperty
    DataFormItem.LayoutType
    DataFormItem.LayoutTypeProperty
    DataFormItem.LeadingView
    DataFormItem.LeadingViewPosition
    DataFormItem.LeadingViewPositionProperty
    DataFormItem.LeadingViewProperty
    DataFormItem.OnBindingContextChanged()
    DataFormItem.PlaceholderColor
    DataFormItem.PlaceholderColorProperty
    DataFormItem.PlaceholderText
    DataFormItem.PlaceholderTextProperty
    DataFormItem.PropertyInfo
    DataFormItem.SetValue(Object)
    DataFormItem.ShowErrorLabel
    DataFormItem.ShowErrorLabelProperty
    DataFormItem.ShowLabel
    DataFormItem.ShowLabelProperty
    DataFormItem.ShowLeadingView
    DataFormItem.ShowLeadingViewProperty
    DataFormItem.ShowTrailingView
    DataFormItem.ShowTrailingViewProperty
    DataFormItem.ShowValidMessageLabel
    DataFormItem.ShowValidMessageLabelProperty
    DataFormItem.TextInputLayoutSettings
    DataFormItem.TextInputLayoutSettingsProperty
    DataFormItem.TrailingView
    DataFormItem.TrailingViewPosition
    DataFormItem.TrailingViewPositionProperty
    DataFormItem.TrailingViewProperty
    DataFormItem.ValidMessageLabelTextStyle
    DataFormItem.ValidMessageLabelTextStyleProperty
    DataFormTextEditorItem.Keyboard
    DataFormTextEditorItem.KeyboardProperty
    DataFormTextEditorItem.MaxLength
    DataFormTextEditorItem.MaxLengthProperty
    DataFormViewItem.ColumnSpan
    DataFormViewItem.ColumnSpanProperty
    DataFormViewItem.IsVisible
    DataFormViewItem.IsVisibleProperty
    DataFormViewItem.OnPropertyChanged(String)
    DataFormViewItem.Padding
    DataFormViewItem.PaddingProperty
    DataFormViewItem.RowOrder
    DataFormViewItem.RowOrderProperty
    DataFormViewItem.RowSpan
    DataFormViewItem.RowSpanProperty
    Namespace: Syncfusion.Maui.DataForm
    Assembly: Syncfusion.Maui.DataForm.dll
    Syntax
    public class DataFormNumericItem : DataFormTextEditorItem, IThemeElement
    Examples

    The below example shows how to create data form numeric item and how to assign properties to numeric editor.

    • XAML
    • C#
    • C#
    <dataForm:SfDataForm x:Name="dataForm"
            DataObject="{Binding DataModel}">
        <dataForm:SfDataForm.Items>
        <dataForm:DataFormNumericItem
            x:Name="numericItem"
            FieldName="Amount"
            AllowNull="True">
        </dataForm:DataFormNumericItem>
        </dataForm:SfDataForm.Items>
    </dataForm:SfDataForm>
    public class DataModel
    {
       public string Amount { get; set; }
       public double Balance { get; set; }
    }
    this.dataForm.DataObject = new DataModel();
    this.dataForm.RegisterEditor(nameof(DataModel.Amount), DataFormEditorType.Numeric);
    this.dataForm.GenerateDataFormItem += OnGenerateDataFormItem;
    private void OnGenerateDataFormItem(object sender, GenerateDataFormItemEventArgs e)
    {
        if (e.DataFormItem != null)
        {
            if (e.DataFormItem is DataFormNumericItem amount && e.DataFormItem.FieldName == nameof(DataModel.Amount))
            {
                amount.AllowNull = true;
                amount.CustomFormat = "C";
                amount.Culture = new CultureInfo("fr-FR");
                amount.Maximum = 10;
                amount.Minimum = 1;
                amount.ShowClearButton = true;
                amount.SmallChange = 5.0;
                amount.LargeChange = 20.0;
                amount.UpDownPlacementMode = NumericEditorUpDownPlacementMode.Inline;
            }
            else if (e.DataFormItem is DataFormNumericItem balance && e.DataFormItem.FieldName == nameof(DataModel.Balance))
            {
                balance.AllowNull = true;
                balance.CustomFormat = "#.# dollar";
                balance.Culture = new CultureInfo("en-US");
                balance.Maximum = 10;
                balance.Minimum = 1;
                balance.ShowClearButton = true;
                balance.SmallChange = 10.0;
                balance.LargeChange = 40.0;
                balance.UpDownPlacementMode = NumericEditorUpDownPlacementMode.Hidden;
            }
        }
    }

    Constructors

    DataFormNumericItem()

    Initializes a new instance of the DataFormNumericItem class.

    Declaration
    public DataFormNumericItem()

    Fields

    AllowNullProperty

    Identifies the AllowNull dependency property.

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

    The identifier for AllowNull dependency property.

    CultureProperty

    Identifies the Culture dependency property.

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

    The identifier for Culture dependency property.

    CustomFormatProperty

    Identifies the CustomFormat dependency property.

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

    The identifier for CustomFormat dependency property.

    LargeChangeProperty

    Identifies the LargeChange dependency property.

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

    The identifier for LargeChange dependency property.

    MaximumProperty

    Identifies the Maximum dependency property.

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

    The identifier for Maximum dependency property.

    MinimumProperty

    Identifies the Minimum dependency property.

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

    The identifier for Minimum dependency property.

    ShowClearButtonProperty

    Identifies the ShowClearButton dependency property.

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

    The identifier for ShowClearButton dependency property.

    SmallChangeProperty

    Identifies the SmallChange dependency property.

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

    The identifier for SmallChange dependency property.

    UpDownPlacementModeProperty

    Identifies the UpDownPlacementMode dependency property.

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

    The identifier for UpDownPlacementMode dependency property.

    Properties

    AllowNull

    Gets or sets a value indicating whether the Syncfusion.Maui.DataForm.DataFormNumericEditor allows null value or not.

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

    true when Syncfusion.Maui.DataForm.DataFormNumericEditor allows null value input, otherwise false. The default value is true.

    Remarks

    Placeholder text will only appear when value is set to NaN or null or when the input is cleared by the user.

    Culture

    Gets or sets the culture for Syncfusion.Maui.DataForm.DataFormNumericEditor.

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

    CustomFormat

    Gets or sets the format used to specify the formatting of editor value.

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

    LargeChange

    Gets or sets the value that is added to or subtracted from Syncfusion.Maui.DataForm.DataFormNumericEditor 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.0.

    Maximum

    Gets or sets the numerical maximum value for Syncfusion.Maui.DataForm.DataFormNumericEditor.

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

    The default value is double.MaxValue.

    Remarks

    If the entered value is greater than Maximum than Maximum value is updated.

    Minimum

    Gets or sets the numerical minimum value for Syncfusion.Maui.DataForm.DataFormNumericEditor.

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

    The default value is double.MinValue.

    Remarks

    If the entered value is less than Minimum than Minimum value is updated.

    ShowClearButton

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

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

    The default value is true.

    SmallChange

    Gets or sets the value that is added to or subtracted from Syncfusion.Maui.DataForm.DataFormNumericEditor value when a small change is made such as with an arrow key, scrolling or using up down button.

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

    The default value is 1.0.

    UpDownPlacementMode

    Gets or sets a value that indicates the placement of buttons used to increment or decrement Syncfusion.Maui.DataForm.DataFormNumericEditor value.

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

    The default value is Hidden.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved