Thanks for responding to my questions!
All of header names are localized, and get its name during run time. We have a framework in place that sets the header name at run time. Therefore, we have to use text block to set header names. Don't think setting a string would be possible here.
here is code snippet that sets name.
if (IsNullOrString(column.Header))
{
// Column UniqueName matches resource display string...
var textBlock = new TextBlock() { TextWrapping = TextWrapping.Wrap, };
if (BindProperty(textBlock, TextBlock.TextProperty, viewModel, column.UniqueName + "Text"))
{
column.Header = textBlock; textBlock.DataContext = viewModel;
}
else
{
string headerText = DisplayStringProvider.GetDisplayString(viewModel, column.UniqueName);
if (headerText != null)
{
textBlock.Text = headerText; column.Header = textBlock;
}
}
}
Thanks,
Amit