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

Header is not showing.

1 Answer 120 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Trump
Top achievements
Rank 1
Trump asked on 02 Jun 2018, 03:15 AM

I followed the Custom Filtering Control in the GridView.

<telerik:RadGridView Name="radGridView" AutoGenerateColumns="False">
  <telerik:RadGridView.Columns>
    <telerik:GridViewDataColumn DataMemberBinding="{Binding FirstName}" Header="First Name" HeaderCellStyle="{StaticResource MyStyle}"/>
    <telerik:GridViewDataColumn DataMemberBinding="{Binding LastName}" Header="Last Name" HeaderCellStyle="{StaticResource MyStyle}"/>
    <telerik:GridViewDataColumn DataMemberBinding="{Binding HireDate}" Header="Hire Date " HeaderCellStyle="{StaticResource MyStyle}">
      <telerik:GridViewDataColumn.FilteringControl>
        <local:FromDateToDateFilterControl FromDate="1/1/1990" ToDate="1/1/1995"/>
      </telerik:GridViewDataColumn.FilteringControl>
    </telerik:GridViewDataColumn>
  </telerik:RadGridView.Columns>
</telerik:RadGridView>

Also I set the style as

<Style x:Key="MyStyle" TargetType="telerik:GridViewHeaderCell">
                      <Setter Property="Foreground" Value="Black" />
                      <Setter Property="Template" Value="{...}" />
                </Style>

But I found the headers are not showing.

I saw the Template contains

<ContentControl x:Name="ContentPresenter" Contemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}"  >

I found the content caused the problem. If I use the hard coded content then I can see the headers.

Many thanks for code help.

1 Answer, 1 is accepted

Sort by
0
Trump
Top achievements
Rank 1
answered on 04 Jun 2018, 11:44 PM
Resolved it.
Tags
GridView
Asked by
Trump
Top achievements
Rank 1
Answers by
Trump
Top achievements
Rank 1
Share this question
or