New to Telerik UI for WPF? Download free 30-day trial

How to Disable the Scroll Wheel in RadNumericUpDown


Product Version 2019.1 318
Product RadNumericUpDown for WPF and Silverlight


How to disable the RadNumericUpDown mouse wheel functionality.


You can disable the scroll wheel functionality of the RadNumericUpDown control globally by defining an attached behavior.


public class MouseWheelBehavior 
        public static bool GetIsEnabled(DependencyObject obj) 
                return (bool)obj.GetValue(IsEnabledProperty); 
        public static void SetIsEnabled(DependencyObject obj, bool value) 
                obj.SetValue(IsEnabledProperty, value); 
        public static readonly DependencyProperty IsEnabledProperty = 
                DependencyProperty.RegisterAttached("IsEnabled", typeof(bool), typeof(MouseWheelBehavior), new PropertyMetadata(true, OnIsEnabledChanged)); 
        private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 
                if (!(bool)e.NewValue) 
                        var upDown = d as RadNumericUpDown; 
                        upDown.AddHandler(RadNumericUpDown.PreviewMouseWheelEvent, new MouseWheelEventHandler((s, a) => { a.Handled = true; }), true); 
You can then set this behavior via an implicit style to all instances in your application.


<Style TargetType="telerik:RadNumericUpDown"> 
        <Setter Property="local:MouseWheelBehavior.IsEnabled" Value="False" /> 

See Also

In this article