I want to add a button into each row of a DataGrid, which should programmatically be disabled / renamed.
I found out, that it is possible to add a button doing the following:
<DataGrid x:Name="dataGrid_newViews" ItemsSource="{Binding}" AutoGenerateColumns="True" CanUserAddRows="false" Grid.ColumnSpan="2">
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button x:Name="btn_installSnippet" Click="btn_installSnippet_Click">Install</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
When I try to do something like
btn_installSnippet.Content = "abc";
I do get the error message, that the name does not exist in the current context...
Can anybody give me a hint, what I am doing wrong?