I want to add a small arrow in the column header. This worked perfect. And if I click on this arrow, the column should have a ver small size (almost invisible).
So I have to set the column width almost to zero. Is there a way to set the width programmatically? I could only set the header width, but not the full column width.
This is my wpf to show the arrow:
<Style TargetType="telerik:ColumnHeaderContainer" BasedOn="{StaticResource ColumnHeaderContainerStyle}">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Header}" />
<Polygon Grid.Column="1" Points="7.5,5 11.5,2 11.5,8 7.5,5" Stroke="Black" StrokeThickness="1" VerticalAlignment="Bottom"
HorizontalAlignment="Right" MouseDown="SpalteZusammenklappen">
<Polygon.Style>
<Style TargetType="Polygon">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Polygon.Fill">
<Setter.Value>
<SolidColorBrush Color="Black"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Polygon.Fill">
<Setter.Value>
<SolidColorBrush Color="White"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Polygon.Style>
<Polygon.RenderTransform>
<RotateTransform Angle="-37" />
</Polygon.RenderTransform>
</Polygon>
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
So my Header looks like this: