WPF Hyperlink Column in Datagrid
Below i present the code snippet to create a Hyperlink column in Datagrid in a WPF application.
This is applicable when a static text with Hyperlink on it is to be shown in the grid.
< my:DataGridTemplateColumn Header="" MinWidth="100" IsReadOnly="True" >
< my:DataGridTemplateColumn.CellTemplate >
< DataTemplate >
< TextBlock >
< Hyperlink Command="{Binding DataContext.MyCommand, RelativeSource={ RelativeSource FindAncestor, AncestorType ={x:Type my:DataGrid}}}" > HyperLink Text
< /Hyperlink >
< /TextBlock >
< /DataTemplate >
< /my:DataGridTemplateColumn.CellTemplate >
< /my:DataGridTemplateColumn >
Similarly if instead of a statis text any other databound value is to be shown as link it can be specified as value to Binding attribute of Hyperlink tag.
Thanks .It is very useful post.but how to change the name of the Hyperlink programatically as i replace Multilingual Value of Other Culture runtime