How using rotate transform in code behind to rotate transform header text in DataGrid on Silverlight? I don't have conception, but when I try using this code, is not working.
private DataGridTemplateColumn CreateColumn(int index, string header)
{
string cellTemp = string.Format(@"<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
<CheckBox />
</DataTemplate>", index);
DataGridTemplateColumn column = new DataGridTemplateColumn();
column.Header = header;
column.CellTemplate = (DataTemplate)XamlReader.Load(cellTemp);
TransformGroup traGrp = new TransformGroup(){};
traGrp.Children.Add(new RotateTransform(){ Angle = -35});
Style transofrm = new Style(typeof(DataGridTemplateColumn));
transofrm.Setters.Add(new Setter(TextBlock.RenderTransformProperty, traGrp));
column.HeaderStyle = transofrm;
return column;
}
Any idea ?