Hide 'x' (close) on docked window tab

7 posts, 0 answers
  1. Lou
    Lou avatar
    61 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
    Admin
    Dess avatar
    1609 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. UI for WinForms is Visual Studio 2017 Ready
  4. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 19 May 2015 in reply to Dess 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
  5. Dess
    Admin
    Dess avatar
    1609 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
  6. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 19 May 2015 in reply to Dess Link to this post

    Thanks, that worked !

     -Lou

  7. Steve
    Steve avatar
    11 posts
    Member since:
    Jul 2012

    Posted 28 May 2015 in reply to Dess 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

  8. Dess
    Admin
    Dess avatar
    1609 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
Back to Top
UI for WinForms is Visual Studio 2017 Ready