How can I programmatically change the column header similar to this code:
grid.Columns[0].Header = "Segment";
I've tried the following:
XamDataGrid.FieldLayouts[0].FieldItems[0].Label = "test";
But it doesn't work because I'm setting the columns in the code behind and not the front end like so:
DataTable dtDataGrid = new DataTable(); dtDataGrid.Columns.Add("Segment", typeof(string)); XamDataGrid.DataSource = dtDataGrid.DefaultView;
Hello,
You need to set the Label property off of the instance of your control, eg "grid".
FieldItems worked for me, but you can try using the Fields too.
eg.
grid.FieldLayouts[0].Fields[0].Label = "test";
If this doesn't work please send a sample isolating this.