Hide 'x' (close) on docked window tab

9 posts, 0 answers
  1. Lou
    Lou avatar
    64 posts
    Member since:
    Aug 2014

    Posted 15 May 2015 Link to this post

    Hi,

     How do I hide the 'x' (close) on the top/right side of a docked window tab?

    (See screenshot)

     Thanks,

     -Lou

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 19 May 2015 Link to this post

    Hello Lou,

    Thank you for writing.

    You can hide the close button for all DocumentWIndows by setting the RadDock.ShowDocumentCloseButton property to false.

    Regards,
    Dess
    Telerik
    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. Lou
    Lou avatar
    64 posts
    Member since:
    Aug 2014

    Posted 19 May 2015 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thanks for the reply, Dess. I need to hide the 'x' on only one particular DocumentWindow (not all of them). Is there a way to do that?

     -Lou
  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 19 May 2015 Link to this post

    Hello Lou,

    Thank you for writing back.

    In order to hide the close button for a specific DocumentWindow, you can access the desired TabStripItem and set its ShowCloseButton property to false:
    TabStripItem item = this.documentTabStrip1.TabStripElement.Items[1] as TabStripItem;
    item.ShowCloseButton = false;

    I hope this information helps. If you have any additional questions, please let me know.

    Regards,
    Dess
    Telerik
    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
  5. Lou
    Lou avatar
    64 posts
    Member since:
    Aug 2014

    Posted 19 May 2015 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thanks, that worked !

     -Lou

  6. RTA
    RTA avatar
    14 posts
    Member since:
    Jul 2012

    Posted 28 May 2015 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hi.  I tried a similar thing using the code below and it works to hide the close button, but I also noticed that it causes an exception if you switch between tabs.   Is there something I'm missing?   The code below runs in my form_load method.  

    for (int i = 0; i <= 2; i++)
     {
            item = radDocumentTabStrip_history.TabStripElement.Items[i] as TabStripItem;
            item.ShowCloseButton = false;
     }

     

    From the error message, it looks like a tab is being disposed of and then isn't there when it needs to be re-opened.  Any ideas what can be causing this? 

    Steve

  7. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 29 May 2015 Link to this post

    Hello Steve,

    Thank you for writing.

    I am not sure what is the complete scenario that reproduces the issue. However, if the CloseAction property for the available DockWindows is set to CloseAndDispose this window is closed and then disposed and if you try to access it is possible to encounter an error. Please refer to the Removing ToolWindow and DocumentWindow at Runtime help article.

    If you are still experiencing any further difficulties, it would be greatly appreciated if you specify the exact steps how to reproduce the problem or get back to me with a sample code snippet replicating the issue so I can investigate the precise case. Thank you in advance.

    I hope this information helps. Should you have further questions, I would be glad to help.
     
    Regards,
    Dess
    Telerik
    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
  8. Ronald
    Ronald avatar
    1 posts
    Member since:
    Dec 2018

    Posted 24 Sep 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    This is not working for me.

     

    // Disable close button in dock windows

    CaseViewV2Dock.ShowDocumentCloseButton = false;

    CaseViewV2Dock.ShowToolCloseButton = false;

    I've tried various option in the UI too.See attachments

     

  9. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 25 Sep 2019 Link to this post

    Hello, Ronald,   

    Note that the ShowDocumentCloseButton property controls the visibility of the close button displayed in each tab:

    Each document windows has it own buttons configuration. So you can disable the close button for all document windows using the code snippet below: 

                foreach (DockWindow item in this.radDock1.DockWindows)
                {
                    if (item is DocumentWindow)
                    {
                        item.DocumentButtons = DocumentStripButtons.ActiveWindowList;
                    }
                }

    I hope this information helps.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top