SpinEditor Events not firing

4 posts, 1 answers
  1. Chris Kirkman
    Chris Kirkman avatar
    37 posts
    Member since:
    Jul 2012

    Posted 29 Dec 2010 Link to this post

    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.
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 29 Dec 2010 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Chris Kirkman
    Chris Kirkman avatar
    37 posts
    Member since:
    Jul 2012

    Posted 29 Dec 2010 Link to this post

    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.
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 29 Dec 2010 Link to this post

    Pleased to be able to help, Chris.
    Richard
Back to Top