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

Showing error style programmatically when the EmptyMessage property is set.

2 Answers 62 Views
Input
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 2
Ken asked on 14 May 2009, 07:36 PM
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 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 15 May 2009, 08:56 AM
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.
0
Ken
Top achievements
Rank 2
answered on 15 May 2009, 08:24 PM
That did the trick. Thanks!
Tags
Input
Asked by
Ken
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Ken
Top achievements
Rank 2
Share this question
or