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

Hide RadPane context menu

16 Answers 472 Views
Docking
This is a migrated thread and some comments may be shown as answers.
RoxanaC
Top achievements
Rank 1
RoxanaC asked on 08 Jan 2010, 07:53 AM
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

16 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 08 Jan 2010, 09:03 AM
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.
0
Steve Chadbourne
Top achievements
Rank 1
answered on 11 Jan 2010, 11:38 PM
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



0
Miroslav Nedyalkov
Telerik team
answered on 12 Jan 2010, 12:13 PM
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.
0
RoxanaC
Top achievements
Rank 1
answered on 12 Jan 2010, 01:09 PM
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
0
Miroslav Nedyalkov
Telerik team
answered on 12 Jan 2010, 05:27 PM
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.
0
Sieg
Top achievements
Rank 1
answered on 18 Mar 2010, 09:53 PM
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
0
Miroslav Nedyalkov
Telerik team
answered on 19 Mar 2010, 02:28 PM
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.
0
GuillaumeR
Top achievements
Rank 1
answered on 30 Apr 2010, 11:33 AM
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.
0
Miroslav Nedyalkov
Telerik team
answered on 05 May 2010, 12:14 PM
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.
0
GuillaumeR
Top achievements
Rank 1
answered on 06 May 2010, 10:38 AM
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.
0
Kaloyan
Telerik team
answered on 11 May 2010, 08:45 AM
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.
0
Stephen Miller
Top achievements
Rank 1
answered on 20 May 2010, 07:59 PM
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

 

 

 

 

 

 

0
GuillaumeR
Top achievements
Rank 1
answered on 21 May 2010, 08:41 AM
Thanks you very much for this answer, it is exactly what I wanted.

Guillaume.
0
Varun Jain
Top achievements
Rank 1
answered on 11 Aug 2010, 01:18 PM
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
0
Stephen Miller
Top achievements
Rank 1
answered on 12 Aug 2010, 03:48 PM
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
0
Miroslav Nedyalkov
Telerik team
answered on 13 Aug 2010, 02:44 PM
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
Tags
Docking
Asked by
RoxanaC
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Steve Chadbourne
Top achievements
Rank 1
RoxanaC
Top achievements
Rank 1
Sieg
Top achievements
Rank 1
GuillaumeR
Top achievements
Rank 1
Kaloyan
Telerik team
Stephen Miller
Top achievements
Rank 1
Varun Jain
Top achievements
Rank 1
Share this question
or