Rename Radpane title

2 posts, 1 answers
  1. Bipin
    Bipin avatar
    13 posts
    Member since:
    May 2013

    Posted 22 Jul 2013 Link to this post

    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;
                    window.SelectedRadPane = pane1;
                    pane1.ContextMenuTemplate = (DataTemplate)this.Resources["XamlContextMenu"];

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

    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?


  2. Answer
    Rosen Vladimirov
    Rosen Vladimirov avatar
    640 posts

    Posted 23 Jul 2013 Link to this post

    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.

    Rosen Vladimirov
    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 >>
  3. DevCraft banner
Back to Top