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

Major Focus/Tabbing Issue with ShowDialog()

23 Answers 818 Views
Window
This is a migrated thread and some comments may be shown as answers.
Terry Foster
Top achievements
Rank 1
Terry Foster asked on 09 Feb 2011, 02:57 AM
I just started using RadWindow for the modal dialogs in our application and I'm noticing a pretty major issue.  When I launch the window using ShowDialog(), the focus does not seem to be on the window or any of its content.  If I start tabbing, it actually tabs through the controls in the background, starting with control used to launch the window, and they can receive keyboard input.  This is definitely opposed to the built-in Silverlight ChildWindow, which only tabs through its content controls with no way to get at the controls in background.  The issue is very easy to demonstrate with your Configurator Demo for the RadWindow: http://demos.telerik.com/silverlight/#Window/Configurator.  Just click the 'Open Modal' button and tab backwards (Shift+Tab) to see that the configuring controls in the background can be focused and modified with the keyboard.  Please let me when you will be able to have this fixed and if there is a workaround in the meantime.

Thanks,
Terry Foster

23 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 14 Feb 2011, 04:31 PM
Hi Terry,

This is expected when there is no content in the RadWindow control. Could you please try this scenario with a content. Everything should be fine.
 

Regards,
George
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Terry Foster
Top achievements
Rank 1
answered on 14 Feb 2011, 04:55 PM
Yes, that's how I initially discovered the issue.  In my application, I'm using four different RadWindows with lots of (focusable) content, but the issue still presents itself.  When I first launch the window and before I click on any of the content, the focus is still in the background.  Once I click on any of the RadWindow content and give it focus, then it works as expected with no way to put focus on anything in the background again.  Please verify this on your end.

Thanks,
Terry
0
Terry Foster
Top achievements
Rank 1
answered on 16 Feb 2011, 06:35 PM
I found the culprit - it's the 'BusyIndicator' in the Silverlight toolkit.  I use it as the root content of all of my RadWindows.  With it in there, the focus is stays on the background when launched.  When I remove it, everything works as expected.  Modifying the 'TabIndex' or 'IsTabStop' of the 'BusyIndicator' does not seem to make a difference.  Can you advise on a fix for this?

Thanks,
Terry
0
Terry Foster
Top achievements
Rank 1
answered on 16 Feb 2011, 10:52 PM
Some final clarification.  It took me forever to nail down exactly what the difference was between using the Silverlight ChildWindow and Telerik's RadWindow.  When I launch my dialog, I'm loading some data and using the toolkit's BusyIndicator to notify the user and lock them out from doing anything in the dialog until the data is loaded.  The BusyIndicator disables everything in the dialog.  When the load process is done, ChildWindow and RadWindow behave differently.  Basically, RadWindow never manages to put the focus on itself or its content (keeping the focus in the background), but ChildWindow does.  I also noticed another major difference between these two controls: ChildWindow disables everything in the background when shown, RadWindow does not, which also allows for this kind of situation to arise.

In summary, I would suggest working to make the 'ShowDialog' behavior of your RadWindow to be more consistent with ChildWindow, which never allows me to get into these funky states.

Thanks,
Terry
0
George
Telerik team
answered on 17 Feb 2011, 04:08 PM
Hello Terry,

 
Yes, you are right - there are some differences between ChildWindow and RadWindow. Reason for this is because the RadWindow controls is designed to work in three types of applications - silverlight, wpf and the xbap application. 

Best wishes,
George
the Telerik team
0
Terry Foster
Top achievements
Rank 1
answered on 22 Feb 2011, 04:01 PM
Am I to understand that under certain circumstances such as the one I was dealing with, that modal dialogs in wpf and xbap can also allow you to have focus and modify content in the background?  I find this hard to believe, but if true, I'll be quiet.  Otherwise, I would highly suggest you consider modifying the behavior of your RadWindow.  I wasted a full day of work trying to figure out why the modal behavior of the RadWindow does something that, by simple definition of a modal dialog, should not be allowed.

Terry
0
George
Telerik team
answered on 25 Feb 2011, 10:47 AM
Hello Terry,

The reason for this is that we cannot freeze the layout when a modal popup is shown. We open a big transparent window that gets the click of the mouse, not the focus. I would suggest you manually to forbid setting focus to any control in your application except these in the modal window. Sorry for any inconvenience caused.
 
We are making some changes to the RadWindow and we will definitely look into this scenario. 

Please do not hesitate to contact us if you require any further information.


Greetings,
George
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Lance
Top achievements
Rank 1
answered on 18 Mar 2011, 07:51 AM
Hi,

I agree with Terry.  Having focus in the background of a modal dialog doesn't make sense; it goes against the whole principle of modal.  I think "manually forbidding focus to be set to any control in the application except those in the modal window" is convoluted and not really a practical solution.  This is a bug or a design flaw and needs to be fixed.
0
Mike Shilkov
Top achievements
Rank 1
answered on 04 Apr 2011, 03:40 PM
Hello Terry an others.

Did you find any workaround for this issue? I have a dialog BusyIndicator, and it doesn't get focus until user clicks there.

I tried setting focus in Loaded event handler
Dispatcher.BeginInvoke(() => { TextBoxContent.Focus(); });
but it didn't help.

Thanks
---
Mike
0
Terry Foster
Top achievements
Rank 1
answered on 04 Apr 2011, 03:47 PM
I wait until my load process is completely finished and the 'BusyIndicator.IsBusy' property is set to 'false', and then I manually set the focus on my window.  Hope that helps.

Terry
0
Nathaniel
Top achievements
Rank 1
answered on 11 Apr 2011, 09:32 PM
I just stumbled on this today.  In my case, during the BeginningEdit event for a RadGridView , if its for a particular column I create a RadWindow, assign it content and then show the modal dialog. 

RadWindow rw = new RadWindow();

rw.Content = siControl;

 rw.ShowDialog();


The problem is the focus is still in the cell, not in my RadWindow.  I can still type in that cell and I can tab all around the GridView.  How do I get the focus switched to the content of my RadWindow. 
0
Maya
Telerik team
answered on 15 Apr 2011, 02:01 PM
Hi Nathaniel,

I have tried to reproduce the scenario you described, but still without any success. Once the RadWindow is visualized, it gets the focus and editing of the grid is disabled. May you take a look at the sample attached to verify whether there are some misunderstandings according to your particular settings and requirements ? 

 

Best wishes,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nathaniel
Top achievements
Rank 1
answered on 19 Apr 2011, 03:55 PM
Using your example I see the same problems.  I am able to hit tab after the pop-winodw is displayed and the tab causes addtional pop-windows to be created.
0
George
Telerik team
answered on 26 Apr 2011, 01:54 PM
Hello Terry,

 
We reproduced the problem. I would suggest setting a focus on the first textbox on Loaded event handler. This will resolve the issue. Please, refer to the following code snippet:

public PopupControl()
        {
            InitializeComponent();
            this.Loaded += (s, o) =>
                {
                    this.textBox1.Focus();
                };
        }

I hope this helps.


Kind regards,
George
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
pablorocaaig
Top achievements
Rank 1
answered on 09 Jun 2011, 05:54 PM
Hi George,

This trick would not work for me.

All my forms have no controls inside it, they are created dinamically by code, so hacking the Load is not possible.

I need a solution to this.

Regards,

Pablo
0
Yana
Telerik team
answered on 15 Jun 2011, 12:17 PM
Hi Pablo,

In this case you can subscribe to the Loaded event of the textbox and set the focus in its handler.

Hope this helps.

Greetings,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
pablorocaaig
Top achievements
Rank 1
answered on 15 Jun 2011, 05:39 PM
Hi Yana,

Thanks for your reply. That works, but don't fits at all for me. I have an scenario that I must (depending on some code) to set the Focus manually by code even not in the Load event, so I really don't know why this don't works outside the Load event.

Regards,

Pablo Roca
0
pablorocaaig
Top achievements
Rank 1
answered on 15 Jun 2011, 06:02 PM
Hi,

Finally I solved the issue:

Doing an UpdateLayOut prior to the Focus works perfectly. Taken from:

http://www.dotnetspark.com/kb/1792-set-focus-to-textbox-silverlight-3.aspx

(yes it says is a SilverLight 3 bug and I work with SilverLight 4 . but works(

loobject.IsTabStop = True
loobject.UpdateLayOut()
loobject.Focus()

Regards,

Pablo Roca
Spain
0
Yana
Telerik team
answered on 16 Jun 2011, 08:09 AM
Hi Pablo,

I'm glad that you've managed to resolve the issue.

Greetings,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joel Palmer
Top achievements
Rank 2
answered on 31 Aug 2012, 06:23 AM
This issue is not resolved.  I'm working with Visual Studio 2010 with Telerik 2012 Q2 SP1 controls and Silverlight 5.  I've also tried this with the new Visual Studio 2012.  This issue still exists.  However, I don't believe that this has to do with modal forms. 

I have made a screen video of my experience.  Let me know how I can send this. 

Thanks,
Joel.
0
Yana
Telerik team
answered on 04 Sep 2012, 12:05 PM
Hello Joel,

Please open a support ticket and attach the video there. Note that you should first zip it.

Thanks in advance

Greetings,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
koen
Top achievements
Rank 1
answered on 20 Aug 2013, 10:34 AM
We are also encountering this same issue. Any news on a possible solution?

Our application opens a Window when the CellEditEndingEvent is called in a RadGridViewCell. Whatever we try, we cannot focus on the Window.

0
Rosen Vladimirov
Telerik team
answered on 23 Aug 2013, 10:44 AM
Hello Koen,

Can you try the attached project - I've tested it with our latest official version and everything works as expected? What is the version of RadControls that you are using? Can you modify the project to reproduce the issue?

I'm looking forward to hearing from you.

Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Window
Asked by
Terry Foster
Top achievements
Rank 1
Answers by
George
Telerik team
Terry Foster
Top achievements
Rank 1
Lance
Top achievements
Rank 1
Mike Shilkov
Top achievements
Rank 1
Nathaniel
Top achievements
Rank 1
Maya
Telerik team
pablorocaaig
Top achievements
Rank 1
Yana
Telerik team
Joel Palmer
Top achievements
Rank 2
koen
Top achievements
Rank 1
Rosen Vladimirov
Telerik team
Share this question
or