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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

What is the purpose of ValueChangeMode in SfNumericTextBox?

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.

XAML:

 

C#:

 

 

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.

XAML:

<Page

x:Class="Windows_new.MainPage"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:local="using:Windows_new"

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

xmlns:editors="using:Syncfusion.UI.Xaml.Controls.Input"

mc:Ignorable="d">

<Grid x:Name="Grid1" Background="Black">

<editors:SfNumericTextBox x:Name="NumericTextBox1" Width="200" Height="23" ValueChangedMode="OnLostFocus"/>

</Grid>

</Page>

 

C#:

using Syncfusion.UI.Xaml.Controls.Input;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace Windows_new

{

/// <summary>

/// An empty page that can be used on its own or navigated to within a Frame.

/// </summary>

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);

}

}

}

 

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
6595 03/30/2016 03/30/2016 WinRT SfNumericTextBox 4.5 13.4.0.53
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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