OK, we looked into the issue.
Please use "SetBinding" instead of "Binding", and do not set the "Source" of the binding because it will automatically be set to each grid row.
Here is the code that works fine:
Code: Select all
Binding binding = new Binding("Name");
DataGridTextColumn textColumn = new DataGridTextColumn();
textColumn.Header = "Test Header";
Please note that "DataGrid1" has AutoGenerateColums="True". In this case, the manually added column will appear as the first column of the DataGrid.
Let us know if you have any other questions. We are here to help.