Tooltip for Image inside Headertemplate

2 posts, 0 answers
  1. Raj
    Raj avatar
    9 posts
    Member since:
    Oct 2012

    Posted 25 Apr 2013 Link to this post

    Hi,
    I would like to bind a property to an Image present in a headertemplate and a title template
    I tried by providing elementname, relative source, no luck!

    Please help.
    The scenario is:
     <telerik:RadPane.TitleTemplate>
    
      <DataTemplate>
      
     <StackPanel>
    
      <Image Name="Sample">
                                                                                                   <Image.ToolTip>
                                                        <ToolTip></ToolTip>
                                                    </Image.ToolTip>
                                                </Image>
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 30 Apr 2013 Link to this post

    Hi,

    I am not sure I understand you correctly but if you just want to customize the TitleTemplate and add a image to it all you need to do is place the Image control and a TextBlock which Text property is bound with Binding inside a DataTemplate and set it to the TitleTemplate. The next code snippet shows the described approach:
    <telerik:RadSplitContainer>
        <telerik:RadPaneGroup>
            <telerik:RadPane Header="Pane 1" Title="Title 1">
                <telerik:RadPane.TitleTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="img\sun.png" Margin="2" VerticalAlignment="Center">
                                <Image.ToolTip>
                                    <TextBlock Text="Sun"/>
                                </Image.ToolTip>
                            </Image>
                            <TextBlock Text="{Binding}" Margin="5 0 0 0" VerticalAlignment="Center"/>
                        </StackPanel>
                    </DataTemplate>
                </telerik:RadPane.TitleTemplate>
            </telerik:RadPane>
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>

    where the Image Source is the correct source of the image, hope this is helpful.

    Greetings,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top