)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

What is the purpose of ValueChangeMode in SfNumericTextBox?

Platform: UWP |
Control: SfNumericTextBox |
Published Date: June 30, 2016 |
Last Revised Date: July 4, 2019

The ValueChangeMode property is used to update the value property when a key is pressed or focus is lost. It contains two options described below:

  1. OnLostFocus
  2. OnKeyFocus

 OnKeyFocus: When the ValueChangeMode is OnKeyFocus, the value will be changed for each keypress. The following code demonstrates how to set the ValueChangeMode as OnKeyFocus.

Code Snippet

XAML Code

<Grid x:Name="Grid1" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
   <syncfusion:SfNumericTextBox x:Name="Numeric1" Width="200" Height="23" 
                                ValueChangedMode="OnKeyFocus"/>
</Grid>

C# Code

 
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
            SfNumericTextBox NumericTextBox1 = new SfNumericTextBox();
            NumericTextBox1.Width = 200;
            NumericTextBox1.Height = 23;
            NumericTextBox1.ValueChangedMode = ValueChange.OnKeyFocus;
            Grid1.Children.Add(NumericTextBox1);
        }
    }
 

 

OnLostFocus: The value in the SfNumericTextBox change will be updated when the control is no longer focused. The following code demonstrate how to set the ValueChangedMode property as OnLostFocus.

Code Snippet

XAML Code

<Grid x:Name="Grid1" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
   <syncfusion:SfNumericTextBox x:Name="Numeric1" Width="200" Height="23"
                     Value="123.56" ValueChangedMode="OnLostFocus"/>
</Grid>

 

C# Code

    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
            SfNumericTextBox NumericTextBox1 = new SfNumericTextBox();
            NumericTextBox1.Width = 200;
            NumericTextBox1.Height = 23;
            NumericTextBox1.ValueChangedMode = ValueChange.OnLostFocus;
            Grid1.Children.Add(NumericTextBox1);
        }
    }
 

 

2X faster development

The ultimate UWP UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon