IsTabStop causing user to have to click twice.

2 posts, 0 answers
  1. Dave
    Dave avatar
    29 posts
    Member since:
    Aug 2010

    Posted 08 Sep 2014 Link to this post

    I have a RadRibbonView that contains some RadRibbonButtons, and a form with some controls that have LostFocus events.

    These LostFocus events need to fire before the click event of one of the buttons in the ribbon.

    I set the IsTabStop property to true on the buttons, but now when I click on the button, the first click only sets the focus, requiring me to click again to fire the button event.

    What is the correct approach to have the current control lose focus when a button is clicked, and have this button execute?

  2. Martin Ivanov
    Martin Ivanov avatar
    1590 posts

    Posted 09 Sep 2014 Link to this post

    Hi Dave,

    RadRibbonButtons are designed not to get the focus when they are clicked. Setting the IsTabStop property to True is one of the correct ways to allow them to get the focus.

    I guess you are testing the events with break points in Visual Studio. Note that when the IsTabStop of the button is False the LostFocus property of the controls placed inside your form should not be fired. However, when the break point in the button's Click event handler is hit, VS is getting the focus and this is why the LostFocus event handler is fired. 

    This same behavior is preventing the click of the button to be executed. Your application lost focus when the break point hits and the click is never called. 

    You can see that the events are fired as expected in the attached project (in the Visual Studio's Output window). If this is not your case and the issue still occurs I would ask you to send us an isolated project that demonstrates it. This will allow us to test it locally and investigate what stands behind the reported behavior.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top