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

SpinEditor Events not firing

3 Answers 120 Views
SpinEditor
This is a migrated thread and some comments may be shown as answers.
Chris Kirkman
Top achievements
Rank 1
Chris Kirkman asked on 29 Dec 2010, 03:10 PM
I'm using version 2010.3.10.1109 of the Telerik controls.

I'm trying to handle key strokes on a RadSpinEditor control; however the events are not being raised (so far as I can tell).  The ValueChanging event does happen; however I'm trying to subscribe to the KeyPress, KeyDown, KeyUp and none of those are happening. 

My real dilemna is that I've established a Maximum and Minimum value for the spin editor.  When a user enters a value outside those boundaries the control automatically sets the value to the min or max without telling the user that it did it.  I want to know when this happens and inform the user myself.

3 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 29 Dec 2010, 03:20 PM
Hello Chris,

To handle the keydown events (and so on) subscribe to the events of the textboxitem which is inside the RadSpinEditor, rather than those of the spin editor itself.
For exmaple
AddHandler Me.RadSpinEditor1.SpinElement.TextBoxItem.KeyDown, AddressOf RadSpinEditor1_KeyDown

Private Sub RadSpinEditor1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
    MessageBox.Show(e.KeyData.ToString())
End Sub

Hope this helps, but let me know if you need more information.
Regards,
Richard
0
Chris Kirkman
Top achievements
Rank 1
answered on 29 Dec 2010, 03:38 PM
That did it.  Thanks.  I'm just extending the control and creating a new event that it will raise when the value entered falls outside the bounds that are defined by the # of decimal places allowed and the min and max values.

Thanks alot.
0
Richard Slade
Top achievements
Rank 2
answered on 29 Dec 2010, 03:41 PM
Pleased to be able to help, Chris.
Richard
Tags
SpinEditor
Asked by
Chris Kirkman
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Chris Kirkman
Top achievements
Rank 1
Share this question
or