This is a migrated thread and some comments may be shown as answers.

[Solved] Numeric Box stop mouse wheel scrolling from changing value

3 Answers 213 Views
NumericBox for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Simon
Top achievements
Rank 1
Simon asked on 02 Dec 2013, 08:59 PM
Is there a way to stop the mouse wheel scrolling from changing the value of the numeric spinner?
I can't see anything in the documentation related to this.

Thanks
Simon

3 Answers, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 03 Dec 2013, 09:34 AM
Hello Simon,

Thank you for contacting us.

The RadNumericBox executes this logic in a method that is called before the PointerWheelChanged event and the control marks the PointerRoutedEventArgs.Handled as true. So, in order to achieve the desired result, you will need to implement a class that derives from the RadNumericBox and override the OnPointerWheelChanged method where you should not call the base method.
public class NumericBox : RadNumericBox
{
    protected override void OnPointerWheelChanged(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
    {
    }
}

I hope this helps. Let me know should you have any questions or suggestions.

Regards,
Ivaylo Gergov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Simon
Top achievements
Rank 1
answered on 03 Dec 2013, 02:39 PM
I tried as you suggested but am now getting an error thrown from the App (in App.g.i.cs) which crashes the app.

{"No installed components were detected.\r\n\r\nCannot apply a Style with TargetType 'Telerik.UI.Xaml.Controls.Input.RadNumericBox' to an object of type 'Windows.UI.Xaml.IDependencyObject'."}

I am changing many styles in code behind, but the target types are actually "NumericTextBox" and "InlineButton" not "RadNumericBox".  
This workaround may not work for me.



0
Ivaylo Gergov
Telerik team
answered on 04 Dec 2013, 10:06 AM
Hello Simon,

Could you please send me a sample project that reproduces this error because I was not able to reproduce it on my side.

I am looking forward to your reply. Thank you for understanding.

Regards,
Ivaylo Gergov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
NumericBox for XAML
Asked by
Simon
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Simon
Top achievements
Rank 1
Share this question
or