Hello,
Welcome to our Microsoft Q&A platform!
If you want to customize columns, you can use DataGridTemplateColumn. The DataGridTemplateColumn type enables you to create your own column types by specifying the cell templates used to display values. If you want to achieve it in code-behind, you need to create a dataTemplate contain button and apply it in the CellTemplate of DataGridTemplateColumn.
You can see more details from here.