I'm attempting to bind the Tag property on the SeverityString below to the value of the QualityCodeToolTip field below it. I've attempted to do this with
relative pathting, but I have not found the proper ancestor and path. Please take a look at the relative path on the Tag attribute for
SeverityString below and provide the proper syntax to map to the QualityCodeToolTip field below it. If you have a suggestion of a better way to accomplish this mapping,
that would be great too. Thanks in advance for your help on this.
Patrick
<igDP:FieldLayout Key="SelectedObjects">
<igDP:FieldLayout.FieldSettings>
<igDP:FieldSettings LabelClickAction="SortByOneFieldOnly" />
</igDP:FieldLayout.FieldSettings>
<igDP:FieldLayout.Fields>
</igDP:Field>
<igDP:Field Name="SeverityString" Label="" igDP:XamDataGrid.FieldLayouts
Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:FieldLayout}}, Path
=FieldLayout.QualityCodeToolTip.Value}">
<igDP:FieldSettings CellValuePresenterStyle="{StaticResource QualityCodeToolTipStyle
}"/>
</igDP:Field.Settings>
<igDP:Field Name="QualityCodeToolTip" Label="">
<igDP:Field.Settings>
Alex,
Thanks for your response. The mapping you provided worked perfectly, and the additional article you pointed to ws helpful as well. Thanks again for your help. Keep up the good work.
Patrick,
Thanks for giving more information on the scenario. You could use a simple binding like this to get the value from other cells:
<Style TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="ToolTip"
Value="{Binding Path=Cells[QualityCodeToolTip].Value}">
</Setter>
</Style>
and you can apply that style to the Value and SeverityString fields.
If my previous post was helpful, you should definitely check this blog post out :)
Thanks for your reply. I have a class with Value, SeverityString, and QualityCodeToolTip fields. Ultimately, I want to display the Value and SeverityString fields in the data grid, and I want to use the content of the QualityCodeToolTip field as the content of the tooltip for the Value and Severity String cells. Following the examples you provided on the boards, I was able to set the tool tip on the Value and Severity string cells as follows. (BTW- Thanks for your previosu posts on this subject. They were very helpful.)
But I'm having toruble figuring out how to ge the content from the QualityCodeToolTip into the tool tip in my style. You had a sample writing the tag attribute into a tooltip, so I was working from that. But the end goal is to get the QualityCodeToolTip field into the tool tip text for the Value and Severity String fields. What is the best way to accomplish this?
Thanks for your help on this.
<Style x:Key="QualityCodeToolTipStyle" TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Margin" Value="22,0,0,0"/>
="Left" TextTrimming="CharacterEllipsis"/>
</ControlTemplate>
<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self},Path=Field.Tag}"/>
Hello Patrick,
The Field does not expose a Value property so you cannot do this. If you want to bind something from another cell, you should create a style for either the CellValuePresenter or the DataRecordPresenter, which are the visual representations of the cells and records. Please give us more information on what your ultimate goal is so that we can propose a solution for it.
Thanks.