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

IsTabStop causing user to have to click twice.

1 Answer 57 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 09 Sep 2014, 12:20 AM

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?

Regards,

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 09 Sep 2014, 02:02 PM
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.

Regards,
Martin
Telerik
 
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.
 
Tags
RibbonView and RibbonWindow
Asked by
Dave
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or