radSpinEditor Readonly behavior

4 posts, 0 answers
  1. stephan
    stephan avatar
    3 posts
    Member since:
    May 2013

    Posted 10 Mar 2015 Link to this post

    I am trying to set the spin editor to only allow entry via the Arrow keys but when I set the readonly property to true I can not change the value in the spinControl at all. Is the the expected behavior?

    Thank you.
  2. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 11 Mar 2015 Link to this post

    Hi Stephen,

    Thank you for writing.

    This is the expected and desired behavior. You can hook up the up/down keys, by using the KeyDown event:
    void radSpinEditor1_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.KeyData == Keys.Down)
        {
            radSpinEditor1.PerformStep(-radSpinEditor1.Step);
        }
        if (e.KeyData == Keys.Up)
        {
            radSpinEditor1.PerformStep(radSpinEditor1.Step);
        }
    }

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. stephan
    stephan avatar
    3 posts
    Member since:
    May 2013

    Posted 11 Mar 2015 in reply to Stefan Link to this post

    Thank you that helps.
    Now if I allow mouse clicks on the buttons can I detect if the up or the down button was pressed?
    The mouse event args did not seem to have this information.

    Thank you.

  5. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 12 Mar 2015 Link to this post

    Hello,

    You can hook up straight to the button's Click events:
    radSpinEditor1.SpinElement.ButtonDown.Click
    radSpinEditor1.SpinElement.ButtonUp.Click

    I hope that you find this information useful.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top