locked
Force input into textbox RRS feed

  • Question

  • I have a requirement like when ever a new row is added to grid. One of the column having textbox in this new row is required. How to block user, and put focus into textbox till he enters nonempty string into textbox. Until a string is entered into this textbox, user must not be able to navigate away or be able to work with other controls. please advice.  
    Friday, September 6, 2013 3:00 AM

Answers

  • On LostFocus event of textbox check if textbox is empty or not. If it's empty you can set focus with MyTextBox.Focus(FocusState.Programmatic)
    • Proposed as answer by Anne Jing Tuesday, September 10, 2013 6:34 AM
    • Marked as answer by Anne Jing Monday, September 16, 2013 3:38 AM
    Friday, September 6, 2013 9:32 AM

All replies

  • On LostFocus event of textbox check if textbox is empty or not. If it's empty you can set focus with MyTextBox.Focus(FocusState.Programmatic)
    • Proposed as answer by Anne Jing Tuesday, September 10, 2013 6:34 AM
    • Marked as answer by Anne Jing Monday, September 16, 2013 3:38 AM
    Friday, September 6, 2013 9:32 AM
  • Hi, You can add rectangle that fills all page and has transparent background and focus TextBox. When user enters nonempty string you can set visibility collapsed to rectangle.


    Saturday, September 7, 2013 12:33 AM