Hi,
directly binding by setting Header={Binding PropertyName} seems not be possible. So far I found several ways to bind to a header of a DataGrid. One can be found
here. The prefered way until now I use is
<Grid.Resources><FrameworkElement x:Key="ProxyElement" DataContext="{Binding}" /></Grid.Resources><ContentControl Visibility="Collapsed" Content="{StaticResource ProxyElement}" /><DataGrid AutoGenerateColumns="False"><DataGrid.Columns><DataGridTemplateColumn Header="{Binding DataContext.NameText, Source={StaticResource ProxyElement}}"><DataGridTemplateColumn.CellTemplate><DataTemplate><!-- ... --></DataTemplate></DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn></DataGrid.Columns></DataGrid>
Are there other solutions? Is there a best way to bind to a header?