问题
I defined the DataGridTemplateColumn.HeaderStyle as resource.
<UserControl.Resources>
<Style x:Key="DataGridHeaderStyleProductName" TargetType="sdk:DataGridColumnHeader">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="ProductName" Text="ProductName" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
I need to modify the Text of TextBlock (ProductName) runtime. How can I modify?
来源:https://stackoverflow.com/questions/7934042/how-to-modify-datagridtemplatecolumn-header-content-runtime-in-silverlight