RadNumericTextBox Client Event to be fired when the user change the value even if it's the same ?

3 posts, 0 answers
  1. Noha
    Noha avatar
    30 posts
    Member since:
    Sep 2010

    Posted 25 Nov 2012 Link to this post

    Dear ALL 

    I have a RadNumericTextBox and I use a client event called "OnValueChanged" 
    It's called when the user changes the value.

    What I need more is to call another event when the user changes the value even if it's the same value

    i.e if the value is "55" and the user changes it to "55" I need to fire the event

    Any Suggestions ??
  2. Vasil
    Admin
    Vasil avatar
    1642 posts

    Posted 26 Nov 2012 Link to this post

    Hello Noha,

    You could override the _onTextBoxBlurHandler handler, removing the check if the last value is different from the new one. Place this code in <script> tag in your page just after the declaration of your ScriptManager, or above the first RadNumericTextBox in your page:

    Telerik.Web.UI.RadInputControl.prototype._onTextBoxBlurHandler = function (e)
    {
        this._focused = false;
        if (this.isReadOnly())
        {
            return;
        }
        var textBoxValue = this._textBoxElement.value;
     
        //if (this._initialValueAsText + "" !== textBoxValue)
        //{
            this.set_value(textBoxValue);
        //}
        //else
        //{
        //  this.updateDisplayValue();
        //  this.updateCssClass();
        //}
     
        this.raise_blur(Sys.EventArgs.Empty);
    }

    Then handle the OnValueChanging event, instead of OnValueChanged one.

    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.
  3. Noha
    Noha avatar
    30 posts
    Member since:
    Sep 2010

    Posted 29 Nov 2012 Link to this post

    Thanks Vasil, I'll try it
Back to Top