DataGridImageColumn with ToolTip

Posted by: metabear on 7 August 2017, 5:48 pm EST

  • Posted 7 August 2017, 5:48 pm EST


    how can I add a ToolTip to the DataGridImageColumn in XAML with Databinding?

    I\'m trying next sample, but no luck.

  • Replied 7 August 2017, 5:48 pm EST

    Sorry, here an sample:
    <c1:DataGridImageColumn  Width=\"25\" CanUserSort=\"True\" Binding=\"{Binding Path=aaa, Converter={StaticResource aaa2ImageConverter}}\" >
    <TextBlock Text=\"{Binding Path=aaa, Converter={StaticResource aaa2ToolTipConverter}}\" />

  • Replied 7 August 2017, 5:48 pm EST


    DataGridImageColumn is not a UI element rather it is a logical part of C1DataGrid. Hence, we could not set ToolTip for DataGridImageColumn as you want. As a workaround, I suggest you to use DataGridTemplateColumn wherein, you can define Image control as CellTemplate and set its Tooltip. Here is the suggested markup:

    <c1:C1DataGrid x:Name="c1DataGrid" ItemsSource="{Binding}" AutoGenerateColumns="False">
    <c1:DataGridTemplateColumn Header="C1 Logo">
    <Image Source="c1.png" Stretch="Fill">
    <TextBlock Text="{Binding Name}"/>
    <c1:DataGridNumericColumn Header="Employee ID" Binding="{Binding ID}"/>
    <c1:DataGridTextColumn Header="Employee Name" Binding="{Binding Name}"/>
    <c1:DataGridTextColumn Header="Employee Department" Binding="{Binding Department}"/>
    <c1:DataGridTextColumn Header="Employee Location" Binding="{Binding Location}"/>

    Please find the attached sample implementing the same and let me know in case of any doubts or queries.

  • Marked as Answer

    Replied 7 August 2017, 5:48 pm EST

    if there are no simple alternative - you can close this thread.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels