Put event on SpinButton

5 posts, 1 answers
  1. Jocelyn
    Jocelyn avatar
    148 posts
    Member since:
    Jul 2012

    Posted 23 Feb 2012 Link to this post

    Hi,

    I have 2 RadNumericTextBox. One contains the weight in Kg and the other in Lbs. I have the event "onkeyup" on each controls that update the right RadNumericTextBox with the correct value. Example: if I write 100kg it will update the Lbs to 220.

    My problem is that I use SpinButtons, so the "onkeyup" event is not raised. Can I add an "onclick" event on SpinButtons then I can call my "onkeyup" event?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 24 Feb 2012 Link to this post

    Hello,

    Try the following javascript to add handler for SpinButtons.
    JS:
    function OnButtonClick(sender, args)
     {
      $addHandler(sender.SpinUpButton, "onkeyup", functiononkeyup);
     }


    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jocelyn
    Jocelyn avatar
    148 posts
    Member since:
    Jul 2012

    Posted 24 Feb 2012 Link to this post

    Well, it doesn't work. It just call the "functiononkeyup" indefinitely.
  5. Answer
    Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 28 Feb 2012 Link to this post

    Hi Jocelyn,

    You could use the OnValueChanged client event of the input. It will be fired even if the SpinButtons are clicked.

    All the best,
    Vasil
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Jocelyn
    Jocelyn avatar
    148 posts
    Member since:
    Jul 2012

    Posted 28 Feb 2012 Link to this post

    Yes thanks for the help. I am using OnValueChanged and I just call my OnKeyUp function inside!

    Thanks again.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017