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

RadDocumentPane - Close button in the header

8 Answers 429 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Godwin
Top achievements
Rank 1
Godwin asked on 20 Oct 2011, 04:00 AM
Hi,

I need to show the close button in the header rather than at the right most position of the pane(default view)! Is there any property or style settings to achieve this? Or should I extend the control!

Thanks,
Godwin

8 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 20 Oct 2011, 02:54 PM
Hi Godwin,

To achieve this, you will need to edit the templates for RadPaneGroup and RadPane.

The RadPaneGroupTemplate contains the close button. Remove the button from the template. Instead, place it in the style for TabItemContentPresenter , which can be found in the template of RadPane.

The button works through a Command , so there should be no problems closing the current RadPane once you have moved the button from RadPaneGroup into RadPane.

I hope this solution will suit your scenario. If you need further assistance on this one, please let me know.

Kind regards,
Dani
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Godwin
Top achievements
Rank 1
answered on 20 Oct 2011, 03:39 PM
Hi Dani,

Can you please provide sample code for doing this?

Regards,
Godwin
0
Thomas
Top achievements
Rank 1
answered on 20 Oct 2011, 06:56 PM
Hi Godwin,

Did you look at existing posts regarding this issue? There are several out there and two that I replied to in the last couple of days. I will repeat what I mentioned in the other posts and you can determine whether the solution is satisfactory.

The solution I used to add a close button to the pane tab does not require creating a custom theme. I was originally going down that road but decided that it was too much reworking of the RadDocking control templates and styles. My solution uses a Style for the RadPane/RadDocumentPane and only changes the RadPane.HeaderTemplate with a DataTemplate containing the close button. Everything is contained in the header DataTemplate so you only have to create a global style for the RadDocumentPane and set the HeaderTemplate property to this DataTemplate.

This solution does not remove the close button on the tabstrip if that is a requirement for you. Removing the close button from the tabstrip appears to require a custom theme or editing the Telerik templates, as suggested by Dani, which is more work to implement as mentioned above. I found that leaving the tabstrip close button did not pose any real issue other than a redundant means of closing the selected tab.

You can take a look at the solution I proposed and decide if it meets your requirements.

Here is my original post with the DataTemplate and Style defined:
http://www.telerik.com/community/forums/wpf/docking/placing-closing-x-in-each-pane-header-as-with-vs.aspx

Hope this helps.
0
Godwin
Top achievements
Rank 1
answered on 20 Oct 2011, 07:18 PM
Hi Thomas,

I have already modified the RadDockablePane for incorporating close button. But i need to remove it from tabstrip.

Regards,
Godwin

0
Godwin
Top achievements
Rank 1
answered on 21 Oct 2011, 02:10 AM
Hi Dani,

I am extending the RadDocumentPane using the class file(no xaml). I need to add close button to the header. Can you please guide me on how to change the header data template? Please provide some sample code.

Regards,
Godwin
0
Godwin
Top achievements
Rank 1
answered on 21 Oct 2011, 04:01 PM
Thanks for the suggestions. I could resolve this by extending both the RadPane and RadDocumentPane.

Regards,
Godwin
0
Dani
Telerik team
answered on 25 Oct 2011, 10:06 AM
Hi Godwin,

You could indeed use a HeaderTemplate for the RadPane to include the button. The sample code which Thomas posted here is a good option. As in his sample, you would just need a button with the proper Command and CommandParameter.

However, if you do wish to remove the close button from the tabstrip, you should edit the template of the RadPaneGroup. I attach here a sample illustrating this approach.

If you need further help on this issue, please let me know.

Kind regards,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Godwin
Top achievements
Rank 1
answered on 25 Oct 2011, 01:32 PM
Hi Dani,

I have already implemented this!

Thanks,
Godwin

Tags
Docking
Asked by
Godwin
Top achievements
Rank 1
Answers by
Dani
Telerik team
Godwin
Top achievements
Rank 1
Thomas
Top achievements
Rank 1
Share this question
or