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

How do I clear the RadTextbox after validation

2 Answers 186 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Abdulwahab
Top achievements
Rank 1
Abdulwahab asked on 17 Sep 2012, 09:33 PM
I have a pop_up window which I use to authenticate my users. They put in their username and password. After validating their data, I can't seem to be able to reset/clear the RadTextbox including it's validation message and icon to the state it was before any information was typed in.



How can I achieve this?

2 Answers, 1 is accepted

Sort by
0
Accepted
Todor
Telerik team
answered on 18 Sep 2012, 08:06 AM
Hello Abdulwahab,

You can clear the text in RadTextBox by explicitly setting the Text property:
inputTextBox.Text = string.Empty;
As to the validation, you need to set the validation state to NotValidated:
inputTextBox.ChangeValidationState(ValidationState.NotValidated, "");
In these examples, I assume that the TextBox, that you want to reset has a Name "inputTextBox".

I hope this information helps.

Regards,
Todor
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Abdulwahab
Top achievements
Rank 1
answered on 18 Sep 2012, 02:54 PM
I actually figured out the same solution after posting the question.



Thanks for the prompt response.
Tags
TextBox
Asked by
Abdulwahab
Top achievements
Rank 1
Answers by
Todor
Telerik team
Abdulwahab
Top achievements
Rank 1
Share this question
or