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
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
0
Hello Amige,
You can define the needed DataTemplate in the Window.Resources (containing the UserControl):
And set it as Header and Title Template of the new RadPane you are creating in the code as shown below:
Hope this helps.
Regards,
Kalin
Telerik
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
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
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
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
Thanks for the sample project, it worked as expected.
Regards,
Alberto