Mouse-wheel changes the value of read-only RadSpinEditor

4 posts, 1 answers
  1. George Saveliev
    George Saveliev avatar
    29 posts
    Member since:
    May 2009

    Posted 18 Feb 2011 Link to this post

    Hello!

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

    It seems this is a bug.

    Thank you.

  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 20 Feb 2011 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 23 Feb 2011 Link to this post

    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
  5. George Saveliev
    George Saveliev avatar
    29 posts
    Member since:
    May 2009

    Posted 23 Feb 2011 Link to this post

    Thank you for explanation! 
Back to Top