Event LostFocus of TextBox occurs after tab changing

2 posts, 0 answers
  1. Richard Koslik
    Richard Koslik avatar
    71 posts
    Member since:
    Apr 2010

    Posted 21 Dec 2011 Link to this post

    Hello,

    I have a tabcontrol with 2 tabs. Now I want to check in the LostFocus of my TextBox on the second tab (sdk-Microsoft) if the input is valid or not and if it's not valid then I set the focus on the field again. This is working fine at every situation, except I click on the RadTabControl. There the tab is changed before I get the LostFocus of my TextBox, so I am not able to stop the user changing the tab.

    best regards,
    Richard Koslik
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 26 Dec 2011 Link to this post

    Hi Richard Koslik ,

     If you need to prevent the Tab Selection in certain scenarios, have you considered using the PreviewSelectionChanged event of the RadTabControl. You can perform the validation you do in the LostFocus of the TextBox and set e.Handled to true in order to prevent the selection. Is this suitable for you?

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top