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

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

2 Answers 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Noha
Top achievements
Rank 1
Noha asked on 25 Nov 2012, 10:23 AM
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 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 26 Nov 2012, 12:21 PM
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.
0
Noha
Top achievements
Rank 1
answered on 29 Nov 2012, 11:15 AM
Thanks Vasil, I'll try it
Tags
General Discussions
Asked by
Noha
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Noha
Top achievements
Rank 1
Share this question
or