DataGridColumn HeaderProperty and DynamicResource

Mar 17, 2009 at 12:57 AM
I found interesting problem while was trying to use DynamicResource in DataGridColumn header.
I coded following

    <Window.Resources>
        <sys:String x:Key="HeaderText">Header Text</sys:String>
    </Window.Resources>
    <Grid>
        <tk:DataGrid>
            <tk:DataGrid.Columns>
                <tk:DataGridTextColumn Header="{DynamicResource HeaderText}" Width="100"/>
            </tk:DataGrid.Columns>
        </tk:DataGrid>
    </Grid>

But header displayed empty string.
Moreover in DataGridColumn class HeaderProperty returns null.
Could you please help me to figure out where is the problem and how to correct it.

Thank you.

Coordinator
Mar 17, 2009 at 2:07 AM
The Columns property is unable to use the internal WPF feature inheritance context, which would enable this scenario. It is something we're considering for the .NET 4.0 release.

Ben