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

Mouse-wheel changes the value of read-only RadSpinEditor

3 Answers 101 Views
SpinEditor
This is a migrated thread and some comments may be shown as answers.
George Saveliev
Top achievements
Rank 1
George Saveliev asked on 18 Feb 2011, 10:25 AM

Hello!

Mouse-wheel changes the value of read-only RadSpinEditor.

It seems this is a bug.

Thank you.

3 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 20 Feb 2011, 10:19 PM
Hello George,

You can workaround this by providing your own simple implementation of the RadSpinEditor.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.WinControls.UI;
  
    class MySpinEditor : RadSpinEditor  
    {
  
        public MySpinEditor()
        {
            this.SpinElement.TextBoxItem.TextChanging += new Telerik.WinControls.TextChangingEventHandler(TextBoxItem_TextChanging);
        }
  
        public override string ThemeClassName
        {
            get
            {return typeof(RadSpinEditor).FullName;}
        }  
  
        void TextBoxItem_TextChanging(object sender, Telerik.WinControls.TextChangingEventArgs e)
        {
            e.Cancel = this.SpinElement.ReadOnly;
        }
    }

Hope you find that helpful
Richard
0
Jack
Telerik team
answered on 23 Feb 2011, 07:59 AM
Hello George,

I hope Richard's answer has helped you.

As to the RadSpinEditor itself, we have always striven to keep or controls to be similar to their standard WinForms counterparts. That is why we implemented the same behavior in RadSpinEditor like the one in the default NumericUpDown control. When its ReadOnly property is set to true it disables the editing by using the keyboard, however you can change the value when using the mouse wheel as you have noted, and by using the up and down buttons. I hope this helps.

In case you need further assistance or any other question, we will be glad to help.
 
Best wishes,
Jack
the Telerik team
0
George Saveliev
Top achievements
Rank 1
answered on 23 Feb 2011, 08:41 AM
Thank you for explanation! 
Tags
SpinEditor
Asked by
George Saveliev
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Jack
Telerik team
George Saveliev
Top achievements
Rank 1
Share this question
or