Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Templating the datagrid header?
2 replies. Latest Post by Anand Tripathi on July 12, 2009.
(0)
chrisp_68
Member
18 points
38 Posts
10-21-2008 12:26 PM |
Any ideas how to dynamically template the datagrid header? I can template the columns cells like this
templateColumn.Header =
templateColumn.CellTemplate = (
But cant seem to find a way to do a similar thing for the header. I need to be able to inject some extra controls into the header.
Thanks
Christian
Yi-Lun L...
All-Star
25052 points
2,747 Posts
10-23-2008 3:55 AM |
Hello, the only way to achieve this is to create a HeaderStyle, and it must be done in XAML (at least the Style must be written in XAML).
First import the namespace System.Windows.Controls.Primitives:
xmlns
Now write the HeaderStyle:
Anand Tr...
73 points
50 Posts
07-12-2009 6:43 AM |
Instead of Button (<Button Content="aaa"/>), I have a check box here. I need to chenge the checked property of it at run time. How can I refer that control and change it at run time?