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

Add control to pane header

4 Answers 12 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Amige
Top achievements
Rank 1
Veteran
Amige asked on 24 Feb 2015, 03:52 PM
Hello,

I am trying to add some control to the pane header, I saw this documentation about that, it seems that it's not very complicated using the TitleTemplate property.
The difference in my project is that I am creating the RadPane at runtime. Is it possible to programatically add a control to the pane header? Also I would like to add events to that control.

Thanks in advance,

Alberto 



 

4 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 27 Feb 2015, 01:18 PM
Hello Amige,

You can define the needed DataTemplate in the Window.Resources (containing the UserControl):
<DataTemplate x:Key="PaneHeaderTemplate">
    <Border Background="Red">
        <local:UserControl1 />
    </Border>
</DataTemplate>

And set it as Header and Title Template of the new RadPane you are creating in the code as shown below:

var pane = new RadPane();
pane.HeaderTemplate = this.Resources["PaneHeaderTemplate"] as DataTemplate;
pane.TitleTemplate = this.Resources["PaneHeaderTemplate"] as DataTemplate;
pane.Content = "test";

Hope this helps.

Regards,
Kalin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Amige
Top achievements
Rank 1
Veteran
answered on 06 Mar 2015, 01:50 AM
Hello Kalin thanks for the information.

I have another question, is it possible to do the same but using a RadDocumentPane? 
I try it and it works when the pane is floating, but when it's docked I can't see the control, only the pane title.

Thanks,

Alberto
0
Accepted
Kalin
Telerik team
answered on 09 Mar 2015, 02:04 PM
Hi Amige,

You shouldn't have any issue when using the same approach with the DocumentPane. However I tested the explained scenario and everything worked as expected. Check the attached sample project and let me know if you have any further issues.

Hope this helps.

Regards,
Kalin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Amige
Top achievements
Rank 1
Veteran
answered on 09 Mar 2015, 04:07 PM
Hello Kalin,

Thanks for the sample project, it worked as expected.

Regards,

Alberto
Tags
Docking
Asked by
Amige
Top achievements
Rank 1
Veteran
Answers by
Kalin
Telerik team
Amige
Top achievements
Rank 1
Veteran
Share this question
or