Removing the close button from a floating pane

3 posts, 1 answers
  1. Jonathan
    Jonathan avatar
    15 posts
    Member since:
    Dec 2014

    Posted 21 May 2015 Link to this post


    Is there a way to remove the close button from a floating pane? Setting CanUserClose to False only removes it from pinned/unpinned panes. It's still there when the pane is floating, though it's disabled. I don't want it to show at all since that's confusing to the user.


  2. Answer
    Nasko avatar
    727 posts

    Posted 26 May 2015 Link to this post

    Hello Jonathan,

    In order to achieve the desired appearance of the ToolWindow (floating pane) you need to modify its default Style's Template. In that ControlTemplate the Button with x:Name="CloseButton" should be removed - thus the desired appearance should be achieved:
    <Style BasedOn="{StaticResource ToolWindowStyle}" TargetType="dock:ToolWindow">
        <Setter Property="Template">
            <!--Remove the Button-->
            <!--<telerik:RadButton x:Name="CloseButton" Style="{StaticResource ToolWindow_CloseButtonStyle}" Grid.Row="0" Grid.Column="1" Margin="1 1 3 1" Command="telerik:WindowCommands.Close"/>-->

    We also recommend you to use Implicit Styles  because many of the parts of the control are dynamically created including the ToolWindows. In order for those dynamically created elements to be styled correctly the custom style should be added to the App.xaml.

    Hopes this helps.

    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 Feedback Portal and vote to affect the priority of the items
  3. Jonathan
    Jonathan avatar
    15 posts
    Member since:
    Dec 2014

    Posted 26 May 2015 in reply to Nasko Link to this post

    Thanks Nasko. Works perfectly.
Back to Top