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

Caption visibility

5 Answers 197 Views
Dock
This is a migrated thread and some comments may be shown as answers.
MANLEY HAYE
Top achievements
Rank 1
MANLEY HAYE asked on 07 Nov 2006, 05:26 PM
I cannot seem to set the caption visibility of any of the dock controls:
Dock Panel, DockUserControl or any of the properties,
CloseButtonVisible, TabStripVisible, they are always showing.
Help please as your documentation refers to ToolWindows which is not in your obejct library.

5 Answers, 1 is accepted

Sort by
0
Chris
Telerik team
answered on 08 Nov 2006, 02:11 PM
Hi Manley,
The ToolWindow is now replaced by the DockPanel and you can use the following properties to customize the dockpanel behavior:
TabStripVisible, HideButtonVisible, DropDownButtonVisible, CloseButtonVisible, CaptionVisible.
All these properties will be properly documented for the Service Pack 1 which is about to be released in 2 weeks. Other than that I recommend you download the fixed build which we uploaded today and where we fixed some docking problems mostly related to persisting changes done in design-mode.

Best wishes,
Chris
the telerik team
0
Daniel Plomp
Top achievements
Rank 2
answered on 10 Aug 2007, 09:06 AM
Hi Telerik,

I've just the question if it is possible to hide the 'tab' on a TabbedDocument. I can't hide the tab nor the Close or Pin button(s).

What is it I'm doing wrong?

Thanks,
Daniel
0
Boyko Markov
Telerik team
answered on 10 Aug 2007, 02:05 PM
Hi Daniel,

Yes, this is possible. To hide the close button or the tab on a TabbedDocument you will have to access the children collection of the DockPresentationElement, which is a child of the DockPresentationControl's RootElement (the one you actually see).

By default the DockPresentationElement has three children in its collection. The important child is the third one, which is an instance of DockPresenterLayout which is a container of  DockContentPrimitive and ForceSizeLayoutPanel.

Let's focus on the ForceSizeLayoutPanel which contains a StripLayoutPanel and in that strip there are instances of CaptionLayout and LinePrimitive. As you see, you will have to play a bit with the children collections of the elements in your DockPresentationControl. The CaptionLayout's purpose is to be a container of all caption elements which in our case are instances of RadTabStripElement, CaptionButton and a DropDownButton i.e as you access these elements you will have control of all their properties. To hide an element you could use the Visibility property which you could set to one of the three states - ElementVisibility.Hidden, ElementVisibility.Collapsed or ElementVisibility.Visible.

I hope this helps. Please feel free to write us if you have any further questions.


Best wishes,
Ray
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Daniel Plomp
Top achievements
Rank 2
answered on 13 Aug 2007, 09:23 AM
Hello Ray,

Thanks for the explanation about the TabDocument.
However, I'm having some trouble finding the right collection.

I suppose I'll have to look it up somewhere from code as it isn't present in the designer?
Could you maybe help me out with a code sample?

Thanks,
Daniel
0
Boyko Markov
Telerik team
answered on 13 Aug 2007, 12:29 PM
Hi Daniel,

You can use the example code from the TabbedDocument example in the RadDock section in our QSF which is shipped with our controls suite.

The following code snippet shows how to access and then hide the caption button, close button and tab strip from a new created tabbed document.

C#
    Telerik.WinControls.Docking.CaptionButton caption = ((DocumentPresenterControl)documentPane.DefaultPresenter).DocumentPresenterElement.CommandPanel.Children[0].Children[1] as Telerik.WinControls.Docking.CaptionButton;  
            RadDropDownButtonElement ddButton = ((DocumentPresenterControl)documentPane.DefaultPresenter).DocumentPresenterElement.CommandPanel.Children[0].Children[2] as RadDropDownButtonElement;  
            RadTabStripElement tabStrip = ((DocumentPresenterControl)documentPane.DefaultPresenter).DocumentPresenterElement.TabStripElement;  
 
            tabStrip.Visibility = Telerik.WinControls.ElementVisibility.Hidden;  
            ddButton.Visibility = Telerik.WinControls.ElementVisibility.Hidden;  
            caption.Visibility = Telerik.WinControls.ElementVisibility.Hidden;  
     

VB .NET
Dim caption As Telerik.WinControls.Docking.CaptionButton = TryCast((CType(documentPane.DefaultPresenter, DocumentPresenterControl)).DocumentPresenterElement.CommandPanel.Children(0).Children(1), Telerik.WinControls.Docking.CaptionButton)  
            Dim ddButton As RadDropDownButtonElement = TryCast((CType(documentPane.DefaultPresenter, DocumentPresenterControl)).DocumentPresenterElement.CommandPanel.Children(0).Children(2), RadDropDownButtonElement)  
            Dim tabStrip As RadTabStripElement = (CType(documentPane.DefaultPresenter, DocumentPresenterControl)).DocumentPresenterElement.TabStripElement  
 
            tabStrip.Visibility = Telerik.WinControls.ElementVisibility.Hidden  
            ddButton.Visibility = Telerik.WinControls.ElementVisibility.Hidden  
            caption.Visibility = Telerik.WinControls.ElementVisibility.Hidden  
 

You could place that code in the newRadButton click event handler after the initialization of the DocumentPane initialization.

I hope that this is helpful.


Regards,
Ray
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
MANLEY HAYE
Top achievements
Rank 1
Answers by
Chris
Telerik team
Daniel Plomp
Top achievements
Rank 2
Boyko Markov
Telerik team
Share this question
or