Dynamically hooking to RadPane

4 posts, 0 answers
  1. Rick Hodder
    Rick Hodder avatar
    17 posts
    Member since:
    Jul 2004

    Posted 28 Jan 2013 Link to this post

    I am using the RadDocking Silverlight control, and I love it, but I'm running into a few problems.

    1. When I dynamically add RadPanes, they seem to lose their "z-order".
    For example, if I add 3 panes (A,B,C) to a panelgroup, when I close pane C, pane A is activated instead of B - it is as if it goes back to the 1st item in the pane group

    Here's how I add panes

     

     public RadDocumentPane AddDocumentPane(string title, UserControl control, string paneGroup, DockPosition position)
            {
                RadPaneGroup group = FindName(paneGroup) as RadPaneGroup;
                RadDocumentPane r = null;

                if (group != null)
                {
                    r = new RadDocumentPane();               
                    r.Title = title;
                    r.Content = control;               
                    group.AddItem(r, position);
                }
               
                return r;
            }

    2. I want to dynamically hook up to the event that fires when a radpane is closed, but I dont see any events like that. How could I do that? 

    3. Is there a way to just loop through all of the open radPanes?

  2. Rick Hodder
    Rick Hodder avatar
    17 posts
    Member since:
    Jul 2004

    Posted 30 Jan 2013 Link to this post

    FIgured out 2: using Close event on RadDocking.
    Figured out 3: RadDocking has Panes collection

    But still cant figure out 1.

    Any ideas?
  3. DevCraft banner
  4. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 31 Jan 2013 Link to this post

    Hi Rick,

    Yes the Close event is triggered when a Pane is closed in the Docking control and you could use the Panes property to access the opened RadPanes.

    About your third questions this is a know issue that was fixed in our Q3 2012 SP1 release of RadControls. All you need to do is download that release or any internal build after it.

    Greetings,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Rick Hodder
    Rick Hodder avatar
    17 posts
    Member since:
    Jul 2004

    Posted 31 Jan 2013 Link to this post

    I cannot change to the version you mention: management wont allow it

    How can I work around it?

    I have tried creating a stack of RadPanes, and then in the RadDocking.Close() event I have tried the following:

     private void ctlDocking_Close(object sender, StateChangeEventArgs e)      
     {
        foreach (RadPane p in e.Panes)
            {
               ReleasePane(p);
            }
            if (PaneStack.Count > 0)
            {
                RadPane giveFocusTo = PaneStack.Pop();
                // tried all of the following, but none seem to work
                giveFocusTo.IsSelected=true;
                giveFocusTo.Focus();
                ctlDocking.ActivePane=giveFocusTo;
               
            }
     }



Back to Top