title: Button in Datagrid
body: <p>i've created a Datagrid Control in WPF in which there is a button in the cell of each row of </p>
  
  <p>Column(Subgraph). how can i make the Button visible only for some cell-rows in the Subgraph-Column.</p>
  
  <pre><code> XAML:
   &lt;DataGridTemplateColumn x:Name="subgraphtyp" Header="H" Width="50"&gt;
        &lt;DataGridTemplateColumn.CellTemplate&gt;
             &lt;DataTemplate&gt;
                 &lt;Button Name="btnTable" Visibility="Visible" Height="20" Width="25"   
                         Click="Button_Table_Click"&gt;
                    &lt;Image Height="16" Source="Subgraph.png" Stretch="Fill" Width="16"/&gt;
                 &lt;/Button&gt;
             &lt;/DataTemplate&gt;
        &lt;/DataGridTemplateColumn.CellTemplate&gt; 
   &lt;/DataGridTemplateColumn&gt;
  </code></pre>