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

radSpinEditor Readonly behavior

3 Answers 87 Views
SpinEditor
This is a migrated thread and some comments may be shown as answers.
stephan
Top achievements
Rank 1
stephan asked on 11 Mar 2015, 12:47 AM
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.

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 11 Mar 2015, 06:53 AM
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.

 
0
stephan
Top achievements
Rank 1
answered on 11 Mar 2015, 05:13 PM
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.

0
Stefan
Telerik team
answered on 12 Mar 2015, 07:01 AM
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.

 
Tags
SpinEditor
Asked by
stephan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
stephan
Top achievements
Rank 1
Share this question
or