I'm trying to figure out how to bind the viability of a DataGrid Template column to the observable collection that is the datacontext for the datagrid. Note: I'm a beginner with this stuff though, so you probably have to explain like you would to a 10yr old...
I know this is is related to this stackoverflow but I still can't seem to get it to go.
I have a breakpoint in the converter but it never gets hit when data is added to the observable collection...
I hope this makes sense... Thanks a lot
<DataGrid AutoGenerateColumns="False" AlternatingRowBackground="LightBlue" ItemsSource="{Binding historyColl}" Margin="0,75,6,26" Name="historyDataGrid" FontSize="12" HorizontalAlignment="Right" Width="381">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Date (dd-mm)" Width="80*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Date}" Background="{Binding Converter={StaticResource TradedBackground}}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Test" Width="50" Visibility="{Binding RelativeSource={x:Static RelativeSource.Self},
Path=FrameworkElement.DataContext, Converter={StaticResource booleanToVisiblityConverter}}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Test}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>