How to modify DatagridTemplateColumn header content runtime in Silverlight?

1.2k Views Asked by At

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?

0

There are 0 best solutions below