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
40
Optional Hyperlinks in XamDataGrid
posted

Hello,

I used a CellValuePresenter to display hyperlinks in the grid successfully after following examples in this forum. thx!

I need to optionally (based on another cell's value) show the hyperlink so some values will be hyperlinked and some will not in the same column that is using the cellvaluepresenter. Is this possible? Any examples would be helpful.

<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="hyperlinkCell">

<Setter Property="Template">

<Setter.Value>

<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">

<TextBlock Margin="{TemplateBinding Padding}" VerticalAlignment="Center" HorizontalAlignment="Right">

<Hyperlink Click="Grid_CellClicked" Tag="{Binding}" >

<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}" HorizontalAlignment="Right"/>

</Hyperlink>

</TextBlock>

</ControlTemplate>

</Setter.Value>

</Setter>

...

<igDP:Field><igDP:Field.Settings>

<igDP:FieldSettings CellValuePresenterStyle="{StaticResource ResourceKey=hyperlinkCell}">

...

Thank You!