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
How to bind style CellValuePresenter without have to specify the exact field name.
posted

I have the following style defined and it works perfectly when assigned to the field's CellValuePresenterStyle property. Is there a way to generically bind so that I don't have to create styles for each field that might possibly use this style?

<Style x:Key="DataGridCellHyperlink" TargetType="{x:Type igDP:CellValuePresenter}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
          <TextBlock VerticalAlignment="Center"
                     HorizontalAlignment="Left"
                     Cursor="Hand"
                     Foreground="Blue"
                     TextDecorations="Underline"
                     Text="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Record.DataItem.model_id}"/>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

Thanks,Rod

 

Parents Reply Children
No Data