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

Programmatically pin the RadPane

3 Answers 173 Views
Docking
This is a migrated thread and some comments may be shown as answers.
RJ
Top achievements
Rank 1
RJ asked on 26 Aug 2010, 11:03 PM

 

Hi,

 

How can I pin the RadPane programmatically when I click on RadPane tab header?

 


Thanks

RJ



3 Answers, 1 is accepted

Sort by
0
Igor Macedo
Top achievements
Rank 2
answered on 31 Aug 2010, 01:12 PM
This should work:

myRadPane.IsPinned = false;

Regards
0
George
Telerik team
answered on 31 Aug 2010, 03:19 PM
Hello,

When a RadPane is unpinned, it goes in an AutoHideArea. I suggest you to handle MouseUp event for the unpinned RadPane and when this RadPane is clicked, pin it. Here is the code to do this:

private void RadDocking_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            RadPane pane = (RadPane)e.OriginalSource;
            if (pane != null && !pane.IsPinned)
            {
                AutoHideArea area = pane.Parent as AutoHideArea;
                if (area != null && area.HasItems)
                {
                    RadPane selectedPane = area.SelectedPane;
                    if (selectedPane != null)
                    {
                        selectedPane.MouseUp += new MouseButtonEventHandler(selectedPane_MouseUp);
                    }
                }
            }
        }
 
        void selectedPane_MouseUp(object sender, MouseButtonEventArgs e)
        {
            var pane = sender as RadPane;
            if (pane != null)
            {
                pane.IsPinned = true;
                pane.MouseUp -= selectedPane_MouseUp;
            }
        }
 
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
0
Igor Macedo
Top achievements
Rank 2
answered on 31 Aug 2010, 04:20 PM
Hello,

This workaround works for me too!

Really thanks!

Regards

Igor
Tags
Docking
Asked by
RJ
Top achievements
Rank 1
Answers by
Igor Macedo
Top achievements
Rank 2
George
Telerik team
Share this question
or