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

RadNumericTextBox, MinValue, and nuked value on postback

1 Answer 82 Views
Input
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 20 Sep 2011, 07:22 PM
I want to use a RadNumericTextBox to enter a value.  If the value is outside of the MinValue/MaxValue range I want the InvalidStyle CSS to be applied, but I still want the value.  I have set AllowOutOfRangeAutoCorrect to false.  So far, so good.  The value displays properly and uncorrected.

But when I do a postback I don't get the OnTextChanged event, presumably because the control has nuked my "invalid" value back to an empty string.  Is there an easy fix for this, or should I just do the css myself.

Thank you.

tg

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 26 Sep 2011, 07:59 AM
Hello Greg,

When you input an incorrect value inside a RadInput control, it does not change its value, so no TextChanged event is fired and this behavior cannot be modified. You could use client script to check the content of the textbox and change its styles dynamically, similarly to what is done here:
Showing Error Style Programmatically?

All the best,
Tsvetina
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
Tags
Input
Asked by
Greg
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or