RadNumericTextBox, MinValue, and nuked value on postback

2 posts, 0 answers
  1. Greg
    Greg avatar
    1 posts
    Member since:
    Jun 2011

    Posted 20 Sep 2011 Link to this post

    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
  2. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 26 Sep 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top