Category / Section
How to restrict the value changing by repeat buttons and mouse wheel in DateTimeEdit?
1 min read
In DateTimeEdit control, pressing repeat buttons and scrolling the Mouse wheel changes the DateTime value of the Control. To restrict the change of values by pressing repeat buttons and Mouse wheel, IsScrollingOnCircle property of DateTimeEdit can be used and its value need to set to False. The same has been demonstrated in the following code snippet:
XAML:
<Window x:Class="DockingManager_155924.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" Title="MainWindow" Height="350" Width="525" > <Grid x:Name="Grid1"> <syncfusion:DateTimeEdit x:Name="datetimeedit" IsVisibleRepeatButton="True" Width="100" Height="23" IsScrollingOnCircle="False"/> </Grid> </Window>
C#:
using Syncfusion.Windows.Shared; namespace DateTimeEdit { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DateTimeEdit datetimeedit = new DateTimeEdit(); datetimeedit.Width = 250; datetimeedit.Height = 23; datetimeedit.IsVisibleRepeatButton = true; datetimeedit.IsScrollingOnCircle = false; Grid1.Children.Add(datetimeedit); } }}