How to stretch group header content to fill up the entire row?

2 posts, 1 answers
  1. Wenrong
    Wenrong avatar
    36 posts
    Member since:
    May 2012

    Posted 09 Sep 2012 Link to this post

    My group header has a custom background, some text that need to align to the left, and some to the right. But now they are all crammed to the left of the header row. How can I make it stretch?

    My header template:

    <DataTemplate x:Key="alarmGridGroupTemplate">
        <Grid Background="{Binding Group.Key, Converter={StaticResource priorityToBrushConverter}}" Height="26" VerticalAlignment="Center">
                <Style TargetType="{x:Type TextBlock}">
                    <Setter Property="FontSize" Value="14" />
                    <Setter Property="Foreground" Value="White" />
                    <Setter Property="VerticalAlignment" Value="Center" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            <TextBlock Text="{Binding Path=Group.Key, Converter={StaticResource priorityToDescriptionConverter}}" Margin="3.5,0" />
            <TextBlock Grid.Column="1" Text="Count:" />
            <TextBlock Grid.Column="2" Text="{Binding Group.ItemCount}" TextAlignment="Right" Margin="5,0,11,0" />
  2. Answer
    Maya avatar
    4062 posts

    Posted 10 Sep 2012 Link to this post

    Hi Wenrong,

    You need to edit the template of GridViewGroupRow and change the elements you want as illustrated in our online documentation

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top