Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1025
Creating a CellValuePresenter Style that access a different cells value for it's tooltip
posted

I have a cellvaluepresenter style specified for a column in my datasource. I would like to show the tooltip for this cell as a different column in the same row. How can I do this? The following line does not work for displaying the model_description as the tooltip for the model_id value.

ToolTip="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:RecordPresenter}}, Path=model_description}"

Field fld = new Field();
            fld.Name = "model_id";
            fld.Settings.CellValuePresenterStyle = Application.Current.FindResource("leftBorderHyperlinkCell") as Style;           
            fld.Label = "Model ID";
            fld.Settings.CellMinWidth = 150.0;
            fld.Settings.AllowEdit = false;
            fl.Fields.Add(fld) 

<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="leftBorderHyperlinkCell">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
          <StackPanel Orientation="Horizontal">
            <StackPanel Orientation="Horizontal">
              <Rectangle Margin="3,0,3,0" Width="3" Height="3" Fill="Black" Stroke="Black"/>
              <TextBlock Foreground="Blue" ToolTip="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:RecordPresenter}}, Path=model_description}" TextDecorations="underline" Cursor="Hand" VerticalAlignment="Center" TextAlignment="Left" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}"/>
            </StackPanel>
          </StackPanel>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

 

Thanks,

Rod

Parents Reply Children
No Data