RadNumericTextbox OnValueChanged Client-Event fires twice

3 posts, 1 answers
  1. Tejas
    Tejas avatar
    31 posts
    Member since:
    Mar 2011

    Posted 24 May 2012 Link to this post

    Hi Team,

    I have RadNumericTextBox on my page with Client-Event OnValueChanged.
    I've defined a client-side function to handle the event. Whenever I change value, It fires the event correctly but when try to set the value to textbox using sender.set_value() method it sets the value and fires the event again. Is this the expected behavior for RadNumericTextBox ?
    Please note that I display a confirmation message to user which is being displayed twice now, I know we can trick the javascript to display message only once but I dont understand why this event fires twice.
    Any clue will be appreciated.


  2. Answer
    Vasil avatar
    1540 posts

    Posted 28 May 2012 Link to this post

    Hello Tejas,

    set_value changes the value of the control, so the ValueChanged event should be fired. By design this is the correct behaviour.

    You may trick it using code like:
    var set_valueCalled = false;
    function HandleValueChanged(sender, args)
        if (!set_valueCalled)
            set_valueCalled = true;
            alert("some alert");
            sender.set_value( "some_new_value");
            set_valueCalled = false;

    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.
  3. DevCraft R3 2016 release webinar banner
  4. Tejas
    Tejas avatar
    31 posts
    Member since:
    Mar 2011

    Posted 29 May 2012 Link to this post

    Thanks for the reply.

Back to Top