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

2 posts, 0 answers
  1. Chris
    Chris avatar
    17 posts
    Member since:
    Nov 2009

    Posted 19 Sep 2012 Link to this post

    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?
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 24 Sep 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top