This question is locked. New answers and comments are not allowed.
I am building a grid dynamically. Part of that building is creating each of the columns. I want to create my own cell header style for my columns which I have done and put into a resource library.
The problem is that when I set this resource programmatically it ignores it...if I do it in XAML it works perfectly. I am further irritated by the fact that almost all of the examples on the Telerik site do all of the code in XAML and none on the backend. Could someone please assist me with this?
The problem is that when I set this resource programmatically it ignores it...if I do it in XAML it works perfectly. I am further irritated by the fact that almost all of the examples on the Telerik site do all of the code in XAML and none on the backend. Could someone please assist me with this?
I have attached a piece of code and picture of it not working...I would have loved to attach a whole project...but apparently I can't do that.
public MainPage()
{
InitializeComponent();
var foo = new GridViewDataColumn();
foo.Header = "test";
foo.DataMemberBinding = new Binding("ContactName");
foo.HeaderCellStyle = (Style)this.Resources["GridViewHeaderCellStyle"];
this.DataGrid.Columns.Add(foo);
}