I want to make a data grid whose columns can be set at runtime. I've found this solution
(other solutions I've seen require setting columns programmatically, not in XAML).
When I'm attempting to use the solution mentioned above, UI generator successfully generates code, but this code doesn't compile due to the following error:
'DataGridColumnHeader' does not contain a definition for 'ContentTemplateProperty'
The code which causes an error:
Setter e_3_Col0_h_s_S_3 = new Setter(DataGridColumnHeader.ContentTemplateProperty, new DataTemplate(e_3_Col0_h_s_S_3_dtFunc));
Also, if there are other ways to implement a data grid with a variable number of columns, I would be glad to know about them.