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

Dynamically hooking to RadPane

3 Answers 77 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 28 Jan 2013, 11:50 PM
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?

3 Answers, 1 is accepted

Sort by
0
Rick
Top achievements
Rank 1
answered on 30 Jan 2013, 08:45 PM
FIgured out 2: using Close event on RadDocking.
Figured out 3: RadDocking has Panes collection

But still cant figure out 1.

Any ideas?
0
Vladi
Telerik team
answered on 31 Jan 2013, 12:26 PM
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.

0
Rick
Top achievements
Rank 1
answered on 31 Jan 2013, 06:11 PM
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;
           
        }
 }



Tags
Docking
Asked by
Rick
Top achievements
Rank 1
Answers by
Rick
Top achievements
Rank 1
Vladi
Telerik team
Share this question
or