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

Rename Radpane title

1 Answer 38 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Bipin
Top achievements
Rank 1
Bipin asked on 22 Jul 2013, 01:27 PM
Hi,
I have to implement rename radpane functionality, where radpane will be added into RadPaneGroup at runtime.
Code -       
                RadPane pane1 = new RadPane();
                pane1.Header = window.InputTextBlock.Text;
                RadPaneUserControl userControl = new RadPaneUserControl();
                pane1.Content = userControl;
                pane1.Visibility = Visibility.Visible;
                radPaneGroup.Items.Add(pane1);
                window.SelectedRadPane = pane1;
                pane1.MakeFloatingOnly();
                pane1.ContextMenuTemplate = (DataTemplate)this.Resources["XamlContextMenu"];

I have added custom context menu to each rad pane. For eg. Rename
<UserControl.Resources>
<DataTemplate x:Key="XamlContextMenu">
            <telerik:RadContextMenu>
                <telerik:RadMenuItem Header="Floating" Command="telerik:RadDockingCommands.Floating" />
                <telerik:RadMenuItem Header="Dockable" Command="telerik:RadDockingCommands.Dockable" />
                <telerik:RadMenuItem Header="Rename" Click="RadMenuItem_Rename_Click" />
            </telerik:RadContextMenu>
 </DataTemplate>               
</UserControl.Resources>

If i change the preview type of radpane  from floating to dockable or tabbed and tries to access that rad pane for rename operation in RadPaneGroup then that rad pane is missing from RadPaneGroup.


Code for accessing RadPane rename operation

var collectionOfPanes = radPaneGroup.EnumeratePanes().Where(x => x.IsSelected);

            foreach (RadPaneGroup group in radSplitContainer.Items)
            {
                foreach (RadPane pane in group.Items)
                {
                    if (pane.IsSelected)
                    {
                        
                    }
                }
            } 


or i have tried this also

RadPane selectePane = (RadPane)radPaneGroup.SelectedItem;

but getting null value.

Please let me know to access selected radpane. Does it remove the radpane from RadPaneGroup?
Note - We dont want to use Commands.

Also let me know how to share source code?

Thankss
Bipin.

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosen Vladimirov
Telerik team
answered on 23 Jul 2013, 12:48 PM
Hi Bipin,

Instead of using RadPane's IsSelected value, you can get the currently active Pane via RadDocking's ActivePane property. When you make RadPane floating (remove it from its docked position), it is no longer part of the same RadPaneGroup. It will be part of the same group after you dock it again. But ActivePane will be currently active pane, no matter in which RadPaneGroup it is.
RadPane selectedPane = this.radDocking.ActivePane;

The other option that you have is to use RadMenuItem's click event to get the Parent RadPane of the sender (sender is RadMenuItem).

Hopefully this helps. Feel free to contact us in case you have any problems or concerns.

Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Docking
Asked by
Bipin
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Share this question
or