I try to set up a Datagrid in wpf. To fill it out I use a DataTable. The problem is that if I want to create a new Column, I can't set the name from a List of string variables, because the Coloumn header will be wrong placed and I can't add values to the rows under the Column. In code:
datatable.Columns.Add(new DataColumn("Test", typeof(string)));//This works
datatable.Columns.Add(new DataColumn(stringlist[i], typeof(string)));//This doesn't work
This illustration shows the wrong placement: