Major Focus/Tabbing Issue with ShowDialog()

24 posts, 0 answers
  1. Terry Foster
    Terry Foster avatar
    60 posts
    Member since:
    Sep 2009

    Posted 08 Feb 2011 Link to this post

    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
  2. George
    Admin
    George avatar
    1332 posts

    Posted 14 Feb 2011 Link to this post

    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>>
  3. DevCraft banner
  4. Terry Foster
    Terry Foster avatar
    60 posts
    Member since:
    Sep 2009

    Posted 14 Feb 2011 Link to this post

    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
  5. Terry Foster
    Terry Foster avatar
    60 posts
    Member since:
    Sep 2009

    Posted 16 Feb 2011 Link to this post

    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
  6. Terry Foster
    Terry Foster avatar
    60 posts
    Member since:
    Sep 2009

    Posted 16 Feb 2011 Link to this post

    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
  7. George
    Admin
    George avatar
    1332 posts

    Posted 17 Feb 2011 Link to this post

    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
  8. Terry Foster
    Terry Foster avatar
    60 posts
    Member since:
    Sep 2009

    Posted 22 Feb 2011 Link to this post

    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
  9. George
    Admin
    George avatar
    1332 posts

    Posted 25 Feb 2011 Link to this post

    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!
  10. Lance
    Lance avatar
    34 posts
    Member since:
    Sep 2007

    Posted 18 Mar 2011 Link to this post

    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.
  11. Mike Shilkov
    Mike Shilkov avatar
    30 posts
    Member since:
    Apr 2010

    Posted 04 Apr 2011 Link to this post

    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
  12. Terry Foster
    Terry Foster avatar
    60 posts
    Member since:
    Sep 2009

    Posted 04 Apr 2011 Link to this post

    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
  13. Nathaniel
    Nathaniel avatar
    68 posts
    Member since:
    Nov 2010

    Posted 11 Apr 2011 Link to this post

    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. 
  14. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 15 Apr 2011 Link to this post

    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
  15. Nathaniel
    Nathaniel avatar
    68 posts
    Member since:
    Nov 2010

    Posted 19 Apr 2011 Link to this post

    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.
  16. George
    Admin
    George avatar
    1332 posts

    Posted 26 Apr 2011 Link to this post

    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
  17. pablorocaaig
    pablorocaaig avatar
    7 posts
    Member since:
    Apr 2011

    Posted 09 Jun 2011 Link to this post

    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
  18. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 15 Jun 2011 Link to this post

    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
  19. pablorocaaig
    pablorocaaig avatar
    7 posts
    Member since:
    Apr 2011

    Posted 15 Jun 2011 Link to this post

    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
  20. pablorocaaig
    pablorocaaig avatar
    7 posts
    Member since:
    Apr 2011

    Posted 15 Jun 2011 Link to this post

    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
  21. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 16 Jun 2011 Link to this post

    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
  22. Joel Palmer
    Joel Palmer avatar
    164 posts
    Member since:
    May 2009

    Posted 31 Aug 2012 Link to this post

    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.
  23. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 04 Sep 2012 Link to this post

    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.

  24. koen
    koen avatar
    6 posts
    Member since:
    Dec 2010

    Posted 20 Aug 2013 Link to this post

    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.

  25. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 23 Aug 2013 Link to this post

    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 >>
Back to Top
DevCraft banner