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
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.
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
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.
This ability to show/hide this context button could be a great feature for a future build!
Regards!
RoxanaC
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.
I would need to add items or commands to the RadPane, how to do it?;
Thanks,
Sieg
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.
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.
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.
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.
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.
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
Guillaume.
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
Best,
Steve
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