How to restrict the decimal values in WPF PercentTextBox?
You can restrict the number of decimal places by using the PercentDecimalDigits property in WPF PercentTextBox.
XAML
<Grid> <syncfusion:PercentTextBox Name="PercentTextBox" PercentDecimalDigits="0" /> </Grid>
C#
// The following code shows how to set the PercentDecimalDigits property for the PercentTextBox.
using Syncfusion.Windows.Tools.Controls;
using Syncfusion.Windows.Shared;
namespace WpfApplication24
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
PercentTextBox.PercentDecimalDigits = 0;
}
}
}
The following output shows that decimal digits are not applied for the PercentTextBox.
