Tooltip on Column title

10 posts, 0 answers
  1. Narendra
    Narendra avatar
    25 posts
    Member since:
    Jul 2010

    Posted 09 Aug 2010 Link to this post

     

     

     

    Hi,

    I want to define a tooltip that will shown, when mouse is over the title of the column.

    Used the below code xaml for tooltip, but it is not showing tooltip.

    <
    telerik:GridViewDataColumn Header="First Name"

     

     

     

    DataMemberBinding="{Binding FirstName}" ToolTip="First Name Tooltip" />

    I am missing any thing.

    Thanks,
    -Narendra

     

  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 10 Aug 2010 Link to this post

    Hello Narendra,

    Use the following code to add a tooltip to column headers:
    <telerik:RadGridView Name="radGridViewHeaderCellTooltip" ItemsSource="{Binding}">
    <telerik:RadGridView.Resources>
    <Style TargetType ="{x:Type telerik:GridViewHeaderCell}">
    <Setter Property="ToolTip" Value="{Binding Content, RelativeSource={RelativeSource Self}}"/>
    </Style>                    
    </telerik:RadGridView.Resources>
    </telerik:RadGridView>

    Kind regards,
    Vanya Pavlova
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Narendra
    Narendra avatar
    25 posts
    Member since:
    Jul 2010

    Posted 10 Aug 2010 Link to this post

    Thanks for the response.

    Is there any other way like setting property of GridViewColumn?

  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 10 Aug 2010 Link to this post

    Hello Narendra,

    Generally there is no built-in property that will set the tooltip of the header in this way,you should implement it yourself and  GridViewHeaderCellStyle  is the easiest  way to achieve this result.

    All the best,
    Vanya Pavlova
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. KENNETH
    KENNETH avatar
    5 posts
    Member since:
    Oct 2010

    Posted 01 Dec 2010 Link to this post

    I would like the grid to pick up the data annotation description as the tool tip. Is this possible?

    My code looks like this:

    [

     

    Display(Name = Consts.DisplayName.MyColumn,Description="Tooltip goes here")]

     

  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 02 Dec 2010 Link to this post

    Hello Narendra,


    Please refer to the following markup, which shows the easiest way to implement a tooltip in GridviewHeaderCell:

    <UserControl.Resources
        <Style x:Key="style1" TargetType="telerik:GridViewHeaderCell">
        <Setter Property="ToolTipService.ToolTip" Value="I am a ToolTip"/>
        </Style>
    </UserControl.Resources>
        <Grid x:Name="LayoutRoot" Background="White">
            <telerik:RadGridView x:Name="gridView1" ShowInsertRow="True" AutoGenerateColumns="False">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="ID" HeaderCellStyle="{StaticResource style1}" DataMemberBinding="{Binding ID}"/>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </Grid>


    You can create the tooltip either in xaml or in code-behind, you can bind it to the property value of your custom object and feel free to modify the code below in in the way you need.


    Regards,
    Vanya Pavlova
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
  8. Paul
    Paul avatar
    4 posts
    Member since:
    Mar 2013

    Posted 16 Apr 2013 Link to this post

    This xaml does indeed add a tool tip when hovering over a column header.  But, afterwards the column header goes blank.  Any ideas?
  9. Paul
    Paul avatar
    4 posts
    Member since:
    Mar 2013

    Posted 16 Apr 2013 Link to this post

    ...for those following the breadcrumbs, here is a telerik workaround to the column header/tooltip issue:
    http://www.telerik.com/community/forums/wpf/gridview/exception-when-binding-the-tootip-of-the-headers.aspx
  10. Sergey
    Sergey avatar
    1 posts
    Member since:
    Jun 2012

    Posted 20 May 2015 Link to this post

    For those, still looking for solution:

    <telerik:RadGridView Name="radGridViewHeaderCellTooltip" ItemsSource="{Binding}">
        <telerik:RadGridView.Resources>
            <!-- you can remove BasedOn if you don't use implicit styles -->
            <Style TargetType ="{x:Type telerik:GridViewHeaderCell}" BasedOn="{StaticResource {x:Type telerik:GridViewHeaderCell}}">
                <Setter Property="ToolTip" Value="{Binding Column.(ToolTipService.ToolTip), RelativeSource={RelativeSource Self}}"/>
            </Style>
        </telerik:RadGridView.Resources>
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Property1}" Header="Property1" ToolTip="Property 1 Tooltip" />
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Property2}" Header="Property2" ToolTip="Property 2 Tooltip" />
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>

  11. Sunil
    Sunil avatar
    2 posts
    Member since:
    Oct 2012

    Posted 07 Dec 2015 in reply to Paul Link to this post

    Use the following line instead. This will not make the header blank.

     <Setter Property="ToolTip" Value="{Binding Content.Text, RelativeSource={RelativeSource Self}}"></Setter>

Back to Top
UI for WPF is Visual Studio 2017 Ready