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

Group Descriptors Header

8 Answers 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Barry
Top achievements
Rank 1
Barry asked on 20 Mar 2013, 12:03 PM
There is a space that is created in the header of the gridview when you add Group Descriptors like this:
<telerik:RadGridView.GroupDescriptors>
   <telerik:GroupDescriptor Member="Tamcn" SortDirection="Ascending"  >
        <telerik:GroupDescriptor.AggregateFunctions>
            <telerik:CountFunction Caption="Item Count: " />
        </telerik:GroupDescriptor.AggregateFunctions>
    </telerik:GroupDescriptor>
</telerik:RadGridView.GroupDescriptors>

And I need to know how to edit the style... it is showing up as the regular Telerik style (office black) and I have a custom style on my gridview and I need that little piece to look the same. Attached is a screen shot of what I'm talking about.

8 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 20 Mar 2013, 12:06 PM
Hello Barry,

 

Have you checked the following online help article? 


Regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Barry
Top achievements
Rank 1
answered on 20 Mar 2013, 12:22 PM
I just need to change the background and this doesn't seem to work:

<Style TargetType="telerik:GridViewHeaderIndentCell">
    <Setter Property="Background" Value="{StaticResource GridView_HeaderBackground}" />
</Style>

This works fine:

<Style TargetType="telerik:GridViewFooterCell">
   <Setter Property="Background" Value="{StaticResource ControlBackgroundNormalGreen}" />
</Style>

So why doesn't the first one work?
0
Vanya Pavlova
Telerik team
answered on 20 Mar 2013, 12:43 PM
Hi Barry,

 


Can you point us to the exact version of RadControls/Silverlight you are currently using? I have performed some tests against Q1 2013 release where everything seems to work correctly.
You may check the attached project for further reference. 



Regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Barry
Top achievements
Rank 1
answered on 20 Mar 2013, 12:57 PM
I'm working with 2012.1.215.1040, which is the latest we can use because we cannot go to Silverlight 5. It just doesn't work no matter what...
0
Barry
Top achievements
Rank 1
answered on 20 Mar 2013, 01:15 PM
I've even tried putting a background on the IndentPresenter... but that doesn't work either.

<telerik:IndentPresenter x:Name="PART_IndentPresenter"
                 Grid.Row="1"
                 Grid.Column="1"
                 MinHeight="{TemplateBinding MinHeight}"
                 Background="Red"
                 IndentLevel="{TemplateBinding IndentLevel}"
                 ItemTemplate="{StaticResource GridViewHeaderIndentCellDataTemplate}"
                 telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" />

And here...

<DataTemplate x:Key="GridViewHeaderIndentCellDataTemplate">
  <telerik:GridViewHeaderIndentCell Background="Orange"  />
</DataTemplate>

doesn't work...
0
Accepted
Vanya Pavlova
Telerik team
answered on 20 Mar 2013, 01:18 PM
Hi Barry,

 

Thank you for getting back to us! I can confirm that we had such an issue, where the Background of this element cannot be set with a simple style. For the time being I may suggest you to directly predefine the template of GridViewHeaderIndentCell and modify its Background from there, as follows:


<SolidColorBrush x:Key="GridView_HeaderInnerBorder" Color="#FF4B4B4B"/>
    <SolidColorBrush x:Key="GridView_HeaderRowOuterBorder" Color="#FF848484"/>
    <SolidColorBrush x:Key="GridView_HeaderRowBackground" Color="Red"/>
    <Style TargetType="telerik:GridViewHeaderIndentCell">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:GridViewHeaderIndentCell">
                    <Border x:Name="OuterBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="25">
                        <Border x:Name="InnerBorder" BorderBrush="{StaticResource GridView_HeaderInnerBorder}" BorderThickness="1" Background="{TemplateBinding Background}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="0 0 1 1"/>
        <Setter Property="BorderBrush" Value="{StaticResource GridView_HeaderRowOuterBorder}"/>
        <Setter Property="Background" Value="{StaticResource GridView_HeaderRowBackground}"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="0"/>
    </Style>



Would it be possible to try with this one and let me know how it goes? 


Kind regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Barry
Top achievements
Rank 1
answered on 20 Mar 2013, 01:40 PM
I was hopeful that this would work, but it doesn't seem to take the style at all... I tried changing the background... and then a few other properties like the width and border colors... it doesn't change anything on the indent cell at all.

It looks like my only option is to hide the indent cell and set the indent on the content to zero so it still lines up with the regular column headers. This should work okay since I'm setting the groupings and they cannot be changed by the user, but it would be nice to be able to go to the latest version so the simple style would work. Its just that my users don't have silverlight 5...
0
Barry
Top achievements
Rank 1
answered on 20 Mar 2013, 02:14 PM
Actually, forget my last post... the last code worked. I had set the old style in the page as well as the resource dictionary, so I had to get rid of the style in the page for the other style to work. It works now... thanks!
Tags
GridView
Asked by
Barry
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Barry
Top achievements
Rank 1
Share this question
or