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

How to hide or disable the 'Hide' option on RadPane contextmenu?

1 Answer 215 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 19 Sep 2012, 10:41 PM
Hi,

I have a RadDocking control and want to hide or disable the 'Hide' option from the contextmenu. There is a CanFloat and CanUserClose property but no CanHide.

Does anyone know how this could be achieved?

1 Answer, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 24 Sep 2012, 02:29 PM
Hi Chris,

Thank you for contacting us.

In order to customize the context menu you will need to edit RadPane style and customize the ContextMenuTemplate by removing the "Hide" RadMenuItem (the item with Close command). The next code snippet represents a sample ContextMenuTemplate taken from the control theme in which the Hide button is removed:
<Setter Property="ContextMenuTemplate">
    <Setter.Value>
        <DataTemplate>
            <telerik:RadContextMenu ClickToOpen="True" InheritDataContext="False">
                <telerik:StyleManager.Theme>
                    <telerik:Office_BlackTheme/>
                </telerik:StyleManager.Theme>
                ...
                <!--<telerik:RadMenuItem CommandTarget="{Binding}" CommandParameter="{Binding}" Command="telerik:RadDockingCommands.Close" Header="{Binding Command.Text, RelativeSource={RelativeSource Self}}" IsChecked="{Binding IsHidden}"/>-->
            </telerik:RadContextMenu>
        </DataTemplate>
    </Setter.Value>
</Setter>


The easiest way to achieve that is by using Implicit Styles.

If you have any other questions feel free to write to us again.

Greetings,
Vladi
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
Docking
Asked by
Chris
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or