Showing error style programmatically when the EmptyMessage property is set.

3 posts, 0 answers
  1. Ken
    Ken avatar
    2 posts
    Member since:
    May 2008

    Posted 14 May 2009 Link to this post

    I'm trying to show the error style programmatically on a RadTextBox (as is outlined here in this post). The problem I'm having is that the error style will not show if the EmptyMessage property has a value of anything other than an empty string. If I leave EmptyMessage as an empty string, it works fine.

    Is there a way to show the error style programmatically and use the EmptyMessage feature?
  2. Dimo
    Admin
    Dimo avatar
    8451 posts

    Posted 15 May 2009 Link to this post

    Hello Ken,

    You can do this only if you set the EmptyMessageStyle to have the same CSS class is the InvalidStyle:

    (Javascript)

    textbox_instance.get_styles().EmptyMessageStyle[1] = "riError";
    textbox_instance.updateCssClass();

    You can set back the "riEmpty" CSS class when required.

    Kind regards,
    Dimo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Ken
    Ken avatar
    2 posts
    Member since:
    May 2008

    Posted 15 May 2009 Link to this post

    That did the trick. Thanks!
Back to Top