I'd like to add a tooltip for particular field I've defined in my XamDataGrid's FieldLayout.Fields collection. The tooltip should be different for each cell in that column ... depending on what the data is. Preferably I'd like to databind the tooltip value to a property in the underlying data object, but it could be done in code as well.
This is what I currently tried:
<
igDP:Field Name="ActionCode" Label="Action Code" Width="150" ToolTip="{Binding Path=ActionCodeName}"/>
Of course, that just places a tooltip on the column header (and actually no text gets displayed, but that's probably a binding problem).
Hello,
I have been looking into this for you and in order to have a different ToolTip for each cell, I suggest you set the CellValuePreenter’s ToolTip through a style. You can use the FieldSettings’ CellValuePresenterStyle property to specify this for a specified field. If you would describe in more details how you get the data for the different ToolTips I might be able to further elaborate my answer.
Please let me know if you require any further assistance on the matter.
OK, I've tried modifying the CellValuePresenter for a particular field, but can't seem to get the data to show. I think it's a binding scope issue or something. Basically I need to bind 2 different properties to a couple properties in the DataItem of the record. I'm trying like this:
<igDP:Field Name="ActionCode" Label="Action Code" Width="150">
<igDP:Field.Settings>
<igDP:FieldSettings>
<igDP:FieldSettings.CellValuePresenterStyle>
<Style TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
<Border BorderThickness="0,0,1,0" BorderBrush="#4C000000">
<eclp:EclpTextBlock HorizontalAlignment="Left" Text="{Binding Path=ActionCode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:XamDataGrid}}}" ToolTip="{Binding Path=ActionCodeName, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:XamDataGrid}}}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</igDP:FieldSettings.CellValuePresenterStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:Field>