This is a migrated thread and some comments may be shown as answers.

How to change row indicator in header column?

1 Answer 240 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Peter Meinl
Top achievements
Rank 1
Peter Meinl asked on 19 Feb 2010, 11:58 AM
I created some filter rows in the header using a custom HeaderCellStyle.

 

 

How can I write some text in the row indicator column of header rows?
See picture attached.

I want to show the text "or" in front of the second and third filter rows.

1 Answer, 1 is accepted

Sort by
0
Accepted
Kalin Milanov
Telerik team
answered on 22 Feb 2010, 08:27 AM
Hi Peter Meinl,

To change the RowIndicator of the header row you will need to edit the template of the header row. In it find the PART_IndicatorPresenter and change the way it looks to fit your case. Below I am sending you the style of the HeaderRow with indicator part being highlighted.

<SolidColorBrush x:Key="GridViewHeaderRowDataCellsPresenterBackground" Color="Transparent"/>
<telerik:Office_BlackTheme x:Key="Theme"/>
<SolidColorBrush x:Key="GridViewHeaderCellInnerBorderBrush" Color="#FFEEEEEE"/>
<DataTemplate x:Key="GridViewHeaderIndentCellDataTemplate">
  <Telerik_Windows_Controls_GridView:GridViewHeaderIndentCell telerik:StyleManager.Theme="{StaticResource Theme}"/>
</DataTemplate>
<telerik:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<ControlTemplate x:Key="GridViewHeaderRowTemplate" TargetType="Telerik_Windows_Controls_GridView:GridViewHeaderRow">
  <Border x:Name="PART_GridViewHeaderRowBorder" Margin="{TemplateBinding Margin}" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
    <Telerik_Windows_Controls_GridView:SelectiveScrollingGrid>
  <Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="*"/>
  </Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.ColumnDefinitions>
                  <Telerik_Windows_Controls_GridView:DataCellsPresenter x:Name="PART_DataCellsPresenter" MinHeight="{TemplateBinding MinHeight}" Background="{StaticResource GridViewHeaderRowDataCellsPresenterBackground}" Grid.Column="3" telerik:StyleManager.Theme="{StaticResource Theme}"/>
  <Border x:Name="PART_IndicatorPresenter" MinHeight="{TemplateBinding MinHeight}" VerticalAlignment="Stretch" Width="24" Visibility="{TemplateBinding RowIndicatorVisibility}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,0" Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">
    <Border Background="{TemplateBinding Background}" BorderBrush="{StaticResource GridViewHeaderCellInnerBorderBrush}" BorderThickness="0,0,1,1"/>
  </Border>
  <Telerik_Windows_Controls_GridView:IndentPresenter x:Name="PART_IndentPresenter" MinHeight="{TemplateBinding MinHeight}" Grid.Column="1" ItemTemplate="{StaticResource GridViewHeaderIndentCellDataTemplate}" Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" IndentLevel="{TemplateBinding IndentLevel}" telerik:StyleManager.Theme="{StaticResource Theme}"/>
  <Border x:Name="PART_HierarchyIndentPresenter" MinHeight="{TemplateBinding MinHeight}" Width="24" Visibility="{Binding HasHierarchy, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,0" Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">
    <Border BorderBrush="{StaticResource GridViewHeaderCellInnerBorderBrush}" BorderThickness="0,0,1,1"/>
  </Border>
    </Telerik_Windows_Controls_GridView:SelectiveScrollingGrid>
  </Border>
</ControlTemplate>
  
<LinearGradientBrush x:Key="GridViewHeaderBackground" EndPoint="0.5,1" StartPoint="0.5,0">
  <GradientStop Color="#FFF8F8F9" Offset="0"/>
  <GradientStop Color="#FFDBDEE1" Offset="1"/>
  <GradientStop Color="#FFDFE2E5" Offset="0.4"/>
  <GradientStop Color="#FFC7CBD1" Offset="0.4"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="GridViewHeaderCellBorderBrush" Color="#FFB3B3B3"/>
<Style x:Key="GridViewHeaderRowStyle" TargetType="Telerik_Windows_Controls_GridView:GridViewHeaderRow">
  <Setter Property="Template" Value="{StaticResource GridViewHeaderRowTemplate}"/>
  <Setter Property="Background" Value="{StaticResource GridViewHeaderBackground}"/>
  <Setter Property="MinHeight" Value="26"/>
  <Setter Property="BorderBrush" Value="{StaticResource GridViewHeaderCellBorderBrush}"/>
  <Setter Property="BorderThickness" Value="0,0,0,1"/>
</Style>

I hope you will find this useful.

Regards,
Kalin Milanov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Peter Meinl
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Share this question
or