I am using the DataGrid with some manually created DataGridTemplateColumns. Here is a code snippet of that in work:
<DataGrid ItemsSource="{Binding Projects, Mode=OneWay}"
SelectedItem="{Binding SelectedProject}"
SelectionMode="Single"
CanUserSortColumns="True"
RowBackground="Transparent">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Art" Width="60" />
<DataGrid.Columns>
<DataGrid>
Everything works just fine, data is loaded and my column is displayed as expected. However, when i try to bind the Header to any property of my ViewModel, no text is displayed in the header.
I already tried to replace the headertemplate with a really simple datatemplate with a textbox, but it seems that the header binding just won't work.
To clarify, i am not binding to the viewmodels in the list that is displayed in the datagrid, but to the viewmodel of my window. It works everywhere else on the window, but not with DataGrid.
What am i doing wrong?