The data template by default is a textblock. You will need to modify it to have a textblock for normal values and a hyperlink button for hyperlinks.
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Value}" FontSize="11" Margin="3,2,3,2" HorizontalAlignment="Left" TextAlignment="left" Visibility="{Binding Converter={StaticResource LinkCollapsedConverter}}"/>
<HyperlinkButton Content="Click for more info..." FontSize="11" Margin="3,2,3,2" HorizontalAlignment="Left" NavigateUri="{Binding Value}" TargetName="_blank" Visibility="{Binding Converter={StaticResource LinkVisibilityConverter}}"/>
</Grid>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
Then create two converters, one for the textblock and another for the hyperlink button. When one is converter evaluates true it will show the element associated with it, the other will be false and hide the element associated with it. public class LinkCollapsedConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
{
return Visibility.Visible;
}
KeyValuePair<string, object> _value = (KeyValuePair<string, object>) value;
if (_value.Value == null)
{
return Visibility.Visible;
}
if (_value.Value.ToString().StartsWith("http"))
{
return Visibility.Collapsed;
}
return Visibility.Visible;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}