Add control to pane header

5 posts, 1 answers
  1. Amige
    Amige avatar
    44 posts
    Member since:
    Dec 2013

    Posted 24 Feb 2015 Link to this post

    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 



     
  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 27 Feb 2015 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Amige
    Amige avatar
    44 posts
    Member since:
    Dec 2013

    Posted 05 Mar 2015 in reply to Kalin Link to this post

    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
  5. Answer
    Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 09 Mar 2015 Link to this post

    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.

     
  6. Amige
    Amige avatar
    44 posts
    Member since:
    Dec 2013

    Posted 09 Mar 2015 in reply to Kalin Link to this post

    Hello Kalin,

    Thanks for the sample project, it worked as expected.

    Regards,

    Alberto
Back to Top
UI for WPF is Visual Studio 2017 Ready