title: Set my Column's value using datatrigger
body: <p>I have a datagrid and I'd like to be able to detect if my column displays 0 using XAML and in this case to replace the zero by "-".</p>
  
  <p>Here is my datagrid : </p>
  
  <pre><code>&lt;DataGrid  Style="{DynamicResource StyleDataGrid}"   ItemsSource="{Binding Path=_Data, UpdateSourceTrigger=PropertyChanged}" Margin="10,54,10,10" Name="dataGridView1" &gt;
                  &lt;DataGrid.Columns&gt;
  
                      &lt;DataGridTextColumn Width="35" Binding="{Binding Path=Object.MyValue}" SortMemberPath="Object.MyValue" Header="" IsReadOnly="true"&gt;
                          &lt;DataGridTextColumn.CellStyle&gt;
                              &lt;Style BasedOn="{StaticResource {x:Type DataGridCell}}" TargetType="DataGridCell"&gt;
                                  &lt;Setter Property="Foreground" Value="{Binding BrushTroisPts}"/&gt;
                                  &lt;Style.Triggers&gt;
                                      &lt;DataTrigger Binding="{Binding Path=TextBlock.Text, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TextBlock}}}" Value="0"&gt;
                                          &lt;Setter Property="TextBlock.Text" Value="-"/&gt;
                                      &lt;/DataTrigger&gt;
  
                                  &lt;/Style.Triggers&gt;
                              &lt;/Style&gt;
                          &lt;/DataGridTextColumn.CellStyle&gt;
                      &lt;/DataGridTextColumn&gt;
  &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>But this doesn't work, How can I make it work ?</p>
  
  <p>Thank you</p>