How do I clear the RadTextbox after validation

3 posts, 1 answers
  1. Abdulwahab
    Abdulwahab avatar
    6 posts
    Member since:
    Apr 2012

    Posted 17 Sep 2012 Link to this post

    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. Answer
    Todor
    Admin
    Todor avatar
    778 posts

    Posted 18 Sep 2012 Link to this post

    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.

  3. DevCraft banner
  4. Abdulwahab
    Abdulwahab avatar
    6 posts
    Member since:
    Apr 2012

    Posted 18 Sep 2012 Link to this post

    I actually figured out the same solution after posting the question.



    Thanks for the prompt response.
Back to Top