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

Hide 'x' (close) on docked window tab

8 Answers 549 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Lou
Top achievements
Rank 1
Lou asked on 15 May 2015, 09:00 PM

Hi,

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

(See screenshot)

 Thanks,

 -Lou

8 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 May 2015, 10:54 AM
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
0
Lou
Top achievements
Rank 1
answered on 19 May 2015, 01:15 PM

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
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 May 2015, 03:05 PM
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
0
Lou
Top achievements
Rank 1
answered on 19 May 2015, 04:02 PM

Thanks, that worked !

 -Lou

0
RTA
Top achievements
Rank 1
answered on 28 May 2015, 03:42 PM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 May 2015, 02:31 PM
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
0
Ronald
Top achievements
Rank 1
answered on 24 Sep 2019, 01:55 PM

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

 

1
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Sep 2019, 07:01 AM

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.
Tags
Dock
Asked by
Lou
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Lou
Top achievements
Rank 1
RTA
Top achievements
Rank 1
Ronald
Top achievements
Rank 1
Share this question
or