i’ve created a Datagrid Control in WPF. how can i make my Button visible only for a Cell
inside the row that i have select it.
anyone can help.
XAML:
<DataGridTemplateColumn x:Name="typ" Header="H." Width="50">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Name="btnTabelle" Visibility="Hidden" Height="20" Width="25"
Click="Button_Table_Click">
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
You can set the Visibility based on if the
DataGridCell.IsSelected, although you will need a BooleanToVisibilityConverter to convert the boolean value to aVisibilityoneHere’s an example, using a
RelativeSourcebinding to find theDataGridCell