I'm trying to programmatically assign a header template for a column. The header template is similar to the GridViewSelectColumn as it just would have a checkbox in it, but I need the column to be able to bind to a property. I did look at the blog post
from Vlad, but it will not work for this particular situation.
Below is the code I have to create a custom template (which works with for an ordinary ListView), but I don't know how to programmatically assign it to the column. I tried setting it to the column.Header property since it's of type object, but that did not work.
FrameworkElementFactory factory =
DataTemplate template =
template.VisualTree = factory;
GridViewCheckBoxColumn column =
Binding(prefix + property.Name);
column.Header = template
// <-- this does not work