Setting the active MdiChild/DockWindow of a RadDock

2 posts, 0 answers
  1. Jill-Connie Lorentsen
    Jill-Connie Lorentsen avatar
    118 posts
    Member since:
    Nov 2008

    Posted 15 Apr 2011 Link to this post

    I have a RadDock with several MdiChildren/DockWindows. When the user closes one of the tabs I want the focus to be set to the previously active tab.

    In the ActiveWindowChanged event I remeber the previous active tab. 

    I've tried both the radDock.ActivateMdiChild(Form) and radDock.ActivateWindow(DockWindow) methods

    What am I missing?

        bool exists = (Array.IndexOf(radDock.MdiChildren, _currentMdi) != -1);
        if (!exists && _prevMdi != null)
        {
            _currentMdi = null;
            _currentDockWindow = null;
              
            //radDock.ActivateMdiChild(_prevMdi);
            radDock.ActivateWindow(_prevDockWindow);
              
        }
     
    _prevMdi = _currentMdi;                   
    _currentMdi = (Form) ((HostWindow) e.DockWindow).Content;

    _prevDockWindow = _currentDockWindow;
    _currentDockWindow = e.DockWindow;

  2. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 20 Apr 2011 Link to this post

    Hi Jill-Connie Lorentsen,

    Please find attached a sample project that follows your requirements. After you close a window, the previously activated window becomes active again. If this is not your requirement, please describe your scenario in greater detail. This will allow me to assist you further.

    All the best,
    Nikolay
    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
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top