Active Tab on Close.

8 posts, 0 answers
  1. Tom
    Tom avatar
    38 posts
    Member since:
    Mar 2007

    Posted 14 Jun 2012 Link to this post

    Does the Rad Dock keep a history of the order in which the tabs become active? If I open "Tab1", then Open "Tab2", then open "Tab3", if I then close "Tab 3" I would expect "Tab 2" to become the active tab or the tab closest to the position of the tab that was closed. Instead, when ever I close any tab the first tab in the control always becomes the active tab.

    Another useful feature would be the ability to drag the tabs around to re-order the tabs like you can in Visual Studio 2010.
  2. Steve
    Steve avatar
    124 posts
    Member since:
    Jun 2011

    Posted 18 Jun 2012 Link to this post

    I second both!
  3. UI for WPF is Visual Studio 2017 Ready
  4. Georgi
    Admin
    Georgi avatar
    349 posts

    Posted 19 Jun 2012 Link to this post

    Hello,

    We have both issues logged in our Public Issue Tracking System. You can vote and track the progress of implementing them here and here. We have scheduled the reordering of the tabs for the Q3 2012 and the PITS item will be updated in the next few days.

    All the best,
    Georgi
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. Scott
    Scott avatar
    30 posts
    Member since:
    Aug 2011

    Posted 09 Nov 2012 Link to this post

    This is a big issue for us. The feedback from our users rate this issue as 'annoying'. I put the issue on hold here but will be forced to resolve it before our next release.

    Everybody reading this, please go here and vote it up. This issue is tracked under Silverlight; hopefully the fix will carry through to the WPF implementation.

    By the way, that issue should be tracked as a usability bug and not a new feature request.
  6. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 14 Nov 2012 Link to this post

    Hi Scott,

    We will try to include the fix of the issue for the 2013 Q1 or later after it. Hope this time frame is OK for you.

    All the best,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Tom
    Tom avatar
    38 posts
    Member since:
    Mar 2007

    Posted 03 Dec 2012 Link to this post

    I finally got tired of waiting for a solution so I came up with my own in about 15 minutes. I don't know what is taking Telerik so long. mainDocking is the name of my RadDocking control and I am using the PreviewClose event. It may not be the most elegant and it doesn't keep track of tab order history but at least it goes to the closest tab instead of the first tab every time.


    void mainDocking_PreviewClose(object sender, StateChangeEventArgs e)
    {
         //only do tab ordering if closing one tab
         if (e.Panes.Count() == 1)
         {
              //get the tab that is closing
              RadPane closingPane = e.Panes.First();
              //ignore closing pane if closing pane is floating or if closing pane is not the active pane
              if (!closingPane.IsFloating && closingPane == mainDocking.ActivePane)
              {
                   bool paneFound = false; //used to determine if the pane that is being closed has been located
                   RadPane newPane = null; //this will be the new active pane
     
                   //go through each pane in the dock to determine the next active pane.
                   foreach (RadPane p in mainDocking.Panes)
                   {
                        //if the current is not floating and current pane is not closing pane the set current pane to next active pane.
                        if (!p.IsFloating && p != closingPane)
                        {
                             newPane = p;
                        }
                        //if current pane is closing pane the set paneFound variable to true.
                        if (p == closingPane)
                        {
                            paneFound = true;
                        }
                        //if we have a new pane selected and we have located the closing pane break loop
                        if (newPane != null && paneFound)
                        {
                            break;
                        }
                   }
                   //if we have found the next active pane set it to the active pane
                   if (newPane != null)
                   {
                        mainDocking.ActivePane = newPane;
                   }
              }
         }
    }
  8. Scott
    Scott avatar
    30 posts
    Member since:
    Aug 2011

    Posted 13 Dec 2012 Link to this post

    A Q1 update would make our initial code freeze date. Putting a Q2 update into our code would have to be evaluated at that time.

    This would make a much better product and would be appreciated by those of us that have posted regarding this issue.

    Thanks for the upate.
  9. Scott
    Scott avatar
    30 posts
    Member since:
    Aug 2011

    Posted 14 Dec 2012 Link to this post

    Using your example as inspiration, I created a more generic way of handling panes. It looks to see if there is a pane in the containing pane group preceeding the one being closed and, if so, activates it. This seems to handle the more complex docking scenarious (e.g., panes in floating windows) although it has not been rigorously tested. Better than just opening the first tab, but not as good as opening the last accessed tab in the group.
    // only do tab ordering if closing one tab
    if (e.Panes.Count() == 1)
    {
        RadPane closingPane = e.Panes.First();
        if (closingPane == _radDocking.ActivePane)
        {
            // find and activate the pane preceeding the one in the group that is closing
            RadPaneGroup paneGroup = closingPane.PaneGroup;
            for (int paneIndex = 1; paneIndex < paneGroup.Items.Count; ++paneIndex)
            {
                if (paneGroup.Items[paneIndex] == closingPane)
                {
                    _radDocking.ActivePane = (RadPane)paneGroup.Items[paneIndex - 1];
                    break;
                }
            }
        }
    }
Back to Top
UI for WPF is Visual Studio 2017 Ready