This question is locked. New answers and comments are not allowed.
Hi there,
Is it possible to change to easily change the GridViewColumnGroup text orientation to vertical?
I've got the following code working to some degree:
<DataTemplate x:Key="VerticalTemp">
<TextBlock Text="{Binding}" TextWrapping="NoWrap" TextAlignment="Left" RenderTransformOrigin="0,0" VerticalAlignment="Stretch">
<TextBlock.RenderTransform >
<CompositeTransform Rotation="-90" TranslateX="0" TranslateY="50"/>
</TextBlock.RenderTransform>
</TextBlock>
</DataTemplate>
<Style x:Key="VerticalStyle" TargetType="telerik:CommonColumnHeader">
<Setter Property="Height" Value="300" />
</Style>
But it seems that the Width of the grid column is affecting the group heading text as though it wasn't rotated, that is to say; if the column is not wide enough to accommodate the text in the group heading in horizontal (0 degrees rotation) it cuts it off, even though when rotated -90 degree there is plenty of height in the heading to accommodate it.
Any help would be greatly appreciated.
EDIT:
I managed to get this sorted by rotating the Textbox's Canvas rather than the textbox itself:
<DataTemplate x:Key="VerticalTemp">
<Canvas RenderTransformOrigin="0.5,0.5" VerticalAlignment="Stretch" HorizontalAlignment="Left">
<Canvas.RenderTransform>
<CompositeTransform Rotation="-90" TranslateX="0" TranslateY="50"/>
</Canvas.RenderTransform>
<TextBlock Text="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Top">
</TextBlock>
</Canvas>
</DataTemplate>
Is it possible to change to easily change the GridViewColumnGroup text orientation to vertical?
I've got the following code working to some degree:
<DataTemplate x:Key="VerticalTemp">
<TextBlock Text="{Binding}" TextWrapping="NoWrap" TextAlignment="Left" RenderTransformOrigin="0,0" VerticalAlignment="Stretch">
<TextBlock.RenderTransform >
<CompositeTransform Rotation="-90" TranslateX="0" TranslateY="50"/>
</TextBlock.RenderTransform>
</TextBlock>
</DataTemplate>
<Style x:Key="VerticalStyle" TargetType="telerik:CommonColumnHeader">
<Setter Property="Height" Value="300" />
</Style>
But it seems that the Width of the grid column is affecting the group heading text as though it wasn't rotated, that is to say; if the column is not wide enough to accommodate the text in the group heading in horizontal (0 degrees rotation) it cuts it off, even though when rotated -90 degree there is plenty of height in the heading to accommodate it.
Any help would be greatly appreciated.
EDIT:
I managed to get this sorted by rotating the Textbox's Canvas rather than the textbox itself:
<DataTemplate x:Key="VerticalTemp">
<Canvas RenderTransformOrigin="0.5,0.5" VerticalAlignment="Stretch" HorizontalAlignment="Left">
<Canvas.RenderTransform>
<CompositeTransform Rotation="-90" TranslateX="0" TranslateY="50"/>
</Canvas.RenderTransform>
<TextBlock Text="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Top">
</TextBlock>
</Canvas>
</DataTemplate>