Home Forums WPF controls Xceed DataGrid for WPF ToolTip on column header?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26418 |

    I would like to display a tooltip when the user mouses over a column’s header that displays static information on what the column is, and how to use it.

    I only want the tooltip on certain columns and the info will be unique from column to column.

    Can anyone help me out? Thank you very much.

    Imported from legacy forums. Posted by Ben (had 3393 views)

    Xceed Support
    Member
    Post count: 5658

    You can provide an implicit ColumnManagerCell style that has the desired tooltip. Take a look at the Displaying Tooltips example in the documentation for more information.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 371 views)

    User (Old forums)
    Member
    Post count: 23064

    Please forgive my ignorance. What documenation are you reffering to?

    I’m looking in the Xceed DataGrid for WPF Documentation that installed with DataGrid 2.0.

    I don’t see any topics for tooltips in the index or when I search. Also I don’t see any tooltip example in the ColumnManagerCell help.

    I must be looking in the wrong spot for the example.

    Imported from legacy forums. Posted by Ben (had 3848 views)

    User (Old forums)
    Member
    Post count: 23064

    Could anyone tell me how to define a tooltip for a column? I can`t see any entry in the documentation..

    Imported from legacy forums. Posted by erfsddfhf (had 371 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Here is the documentation Jenny was referring to:
    http://doc.xceedsoft.com/products/XceedWpfDataGrid/Displaying%20Tooltips.html

    The example demonstrates how to add a ToolTip on any DataCell so that it displays its content as its ToolTip.

    If you want to do the same thing on the column headers, you can do the style on ColumnManagerCell instead.

    For example:

       <Style TargetType=”{x:Type xcdg:ColumnManagerCell}” >
          <Setter Property=”ToolTip”
                      Value=”{Binding RelativeSource={RelativeSource Self}, Path=Content}” />
       </Style>

    If you want a specific ToolTip on a specific column, you need to use DataTriggers.

    For example:

       <Style TargetType=”{x:Type xcdg:ColumnManagerCell}” >
          <Style.Triggers>
             <DataTrigger Binding=”{Binding RelativeSource={RelativeSource Self}, Path=FieldName}”
                                 Value=”Col1Name” >
                <Setter Property=”ToolTip” Value=”ToolTip for Col1″ />
             </DataTrigger>
             <DataTrigger Binding=”{Binding RelativeSource={RelativeSource Self}, Path=FieldName}”
                                 Value=”Col2Name” >
                <Setter Property=”ToolTip” Value=”ToolTip for Col2″ />
             </DataTrigger>
          </Style.Triggers>
       </Style>

     

    Imported from legacy forums. Posted by Diane [Xceed] (had 494 views)

    User (Old forums)
    Member
    Post count: 23064

    Thank you very much, it was most helpful!

    Imported from legacy forums. Posted by erfsddfhf (had 1293 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

        I need to change the column tooltip dynamically in Code behind. I’m binding with datatable in codebehind. Can you please help me how i can do this?

    for

    (int i = _DGCols; i < expGrid.Columns.Count; i++)

    {

    try

    {

    expGrid.Columns[i].Visible =

    true;

    expGrid.Columns[i].Title=”Some Text”;

    expGrid.Columns[i].ToolTip=”Some Text”;//not available

    }

    catch { }

    }

    }

    Imported from legacy forums. Posted by Mukesh (had 530 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Mukesh,

    The Tooltip is on the ColumnManagerCell, not on the Column.

     

    Imported from legacy forums. Posted by Diane [Xceed] (had 1050 views)

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.