Hide RadPane context menu

17 posts, 1 answers
  1. RoxanaC
    RoxanaC avatar
    71 posts
    Member since:
    Dec 2009

    Posted 08 Jan 2010 Link to this post

    Hello!
    I know how to hide pin button, close button
    but I need to hide the context menu button.
    can you help me?

    Thank you!
    RoxanaC
  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 08 Jan 2010 Link to this post

    Hello Roxana,

     Unfortunately there is no straight-forward way to do that in the current version of the Docking control. You can still implement it by handling the Loaded event of the RadPane control and in the handler you could remove all its commands from the MenuCommands collection. Here is an example:

    <telerikDocking:RadPane Header="Pane2" Loaded="RadPane_Loaded">
    </telerikDocking:RadPane>
    private void RadPane_Loaded(object sender, RoutedEventArgs e)
    {
        ((RadPane)sender).MenuCommands.Clear();
    }

    Hope this helps.

    Greetings,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Steve Chadbourne
    Steve Chadbourne avatar
    23 posts
    Member since:
    Nov 2009

    Posted 11 Jan 2010 Link to this post

    Isn't customizing the header just what you describe in your blog entry Miroslav?

    http://blogs.telerik.com/miroslavnedyalkov/posts/09-08-19/customizing_the_header_of_radpane_control_and_adding_behavior_to_it.aspx

    I'm trying to do a similar thing and an struggling to override the header.

    Cheers

    Steve



  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 12 Jan 2010 Link to this post

    Hi Steve,

     Unfortunately the pointed in blog post way is just for adding new buttons to the header and will not help to customize the exiting buttons.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. RoxanaC
    RoxanaC avatar
    71 posts
    Member since:
    Dec 2009

    Posted 12 Jan 2010 Link to this post

    For me it is not enough to remove some or all the commands from the MenuCommands collection :(
    This ability to show/hide this context button could be a great feature for a future build!
    Regards!
    RoxanaC
  7. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 12 Jan 2010 Link to this post

    Hello Roxana,

     We are currently working on this. For Q1 we will deliver better way for customizing the menu of the Docking control.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Sieg
    Sieg avatar
    7 posts
    Member since:
    Feb 2010

    Posted 18 Mar 2010 Link to this post

    Is it possible to have an example of the new way for customizing the menu, now that the 2010 Q1 is out?

    I would need to add items or commands to the RadPane, how to do it?;

    Thanks,
    Sieg
  9. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 19 Mar 2010 Link to this post

    Hello Siegfrid,

     What you need to do is to set the ContextMenuTemplate property of the RadPane control. Please refer to the attached example - it demonstrates the recommended way to add commands to the menu.

    Best wishes,
    Miroslav Nedyalkov
    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.
  10. GuillaumeR
    GuillaumeR avatar
    11 posts
    Member since:
    Jan 2008

    Posted 30 Apr 2010 Link to this post

    Hello !

    This example is the way to customize items in context menu.

    But how can we hide (or template) the button in RadPane header ?

    Thanks,
    Guillaume.
  11. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 05 May 2010 Link to this post

    Hello Guillaume,

     What do you need to hide - items from the menu or buttons from the Header? If you want to remove the ContextMenu its button should be removed automatically.

    Greetings,
    Miroslav Nedyalkov
    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.
  12. GuillaumeR
    GuillaumeR avatar
    11 posts
    Member since:
    Jan 2008

    Posted 06 May 2010 Link to this post

    Hello,

    I want to hide the button in title bar.

    You said that the button should be removed automatically if I remove ContextMenu but how can I remove the context menu ?

    ContextMenu="{x:Null}", the default context menu is still visible. 
    ContextMenuTemplate="{x:Null}", the button does nothing but is still visible in title bar.

    Thanks,
    Guillaume.
  13. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 11 May 2010 Link to this post

    Hello GuillaumeR,

    You can use the code bellow that will remove the RadPane's contextmenu and the button responsible for its opening:

    <telerikDocking:RadPane Header="pane1" ContextMenuTemplate="{x:Null}" />

    Kind regards,
    Kaloyan
    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.
  14. Stephen Miller
    Stephen Miller avatar
    5 posts
    Member since:
    May 2010

    Posted 20 May 2010 Link to this post

    It would be cool if the correct answer was provided...

    This is what I did:

    Simply define the context menu to have no items...

        <Window.Resources> 
            <DataTemplate  
                x:Key="PaneContextMenuTemplate">  
                <telerik:RadContextMenu  
                    InheritDataContext="False" /> 
            </DataTemplate> 
        </Window.Resources> 
     

     

    Then define the context menu template like this:

                        <telerik:RadPane  
                            x:Name="OptionsPanel" 
                            Header="Options" 
                            IsPinned="False" 
                            CanFloat="False" 
                            CanUserClose="False" 
                            CanUserPin="False" 
                            ContextMenuTemplate="{StaticResource PaneContextMenuTemplate}" /> 
     

     

    This produces a pane with no buttons or menus...which is what the posters I believe were asking...setting the template to x:Null does not hide the menu button which I think was the objective...

    I'm using 2010 Q1 controls.

    HTH, Steve

     

     

     

     

     

     

  15. GuillaumeR
    GuillaumeR avatar
    11 posts
    Member since:
    Jan 2008

    Posted 21 May 2010 Link to this post

    Thanks you very much for this answer, it is exactly what I wanted.

    Guillaume.
  16. Varun Jain
    Varun Jain avatar
    6 posts
    Member since:
    Apr 2010

    Posted 11 Aug 2010 Link to this post

    Hello,

    The Solution here just hides all the menu items and shows a blank/empty contextmenu. But I want to hide this blank/empty Menu too. Cud anyone Help me.

    Thanks and Regards,
    Varun Jain
  17. Stephen Miller
    Stephen Miller avatar
    5 posts
    Member since:
    May 2010

    Posted 12 Aug 2010 Link to this post

    Varun, look at the sample code I presented at the bottom of the thread.  It does create an empty context menu, that much is true, but the code also removes the context menu dropdown thus, hiding the button as I assume you're desiring to do.

    Best,
    Steve
  18. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 13 Aug 2010 Link to this post

    Hi Everybody,

     The correct way to remove the ContextMenu is to set the ContextMenuTemplate property to null instead of setting it to an empty context menu.

    All the best,
    Miroslav Nedyalkov
    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
Back to Top
UI for WPF is Visual Studio 2017 Ready