I am using a WPFoolkit DataGrid control, and I would like to reinstall some column headings so that the heading text is displayed vertically and not horizontally (the data in the column is all numeric and therefore not very wide, but the heading text is long). So I created a DataTemplate and tried to get a DataGridColumn.HeaderTemplate to it. This is my template:
<DataTemplate x:Key="headerTemplate"> <StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Left" Background="Aqua"> <StackPanel.LayoutTransform> <RotateTransform Angle="-90"/> </StackPanel.LayoutTransform> <TextBlock Text="{Binding}" VerticalAlignment="Bottom" HorizontalAlignment="Left" Background="Pink"> </TextBlock> </StackPanel> </DataTemplate>
This works just fine, except that the alignment of the header is always left and center. No alignment combination for a StackPanel or TextBlock makes any difference. I would like the text to be centered and down. How can I make it do this?
Thanks,
in
source share