I have a WPF grid bound to the following class:
public class Output{
public string TaskName { get; private set; }
public string Log { get; set; }
}
Grid:
<DataGrid AutoGenerateColumns="False">
<DataGrid.Resources>
<sys:String x:Key="viewdetails">view...</sys:String>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Header="Task" Binding="{Binding TaskName}" />
<DataGridHyperlinkColumn Header="Log"
ContentBinding="{Binding Source={StaticResource viewdetails}}" >
<DataGridHyperlinkColumn.ElementStyle>
<Style TargetType="TextBlock">
<EventSetter Event="Hyperlink.Click" Handler="ViewLogClick" />
</Style>
</DataGridHyperlinkColumn.ElementStyle>
</DataGridHyperlinkColumn>
</DataGrid.Columns>
</DataGrid>
Log is a hyperlink column, on click on the link it show the contents of the log file in a new window.
Is it possible to hide the log link if Output.Log is empty?
Thanks for the replies.
I have created a new property and bound the hyperlink column to LogLink as a workaround: