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

How to build style for GroupHeaderRow when using GroupRenderMode="Flat"?

9 Answers 198 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 14 Dec 2012, 08:35 PM
Hello,

I've recently discovered the GroupRenderMode property in the RadGridView ad would like to try it out to see if it improves any performance issues we have.  I was the original poster who logged this post but unfortunately by switching to "Flat" my styles have dissappeared.

What property do I use to apply a GroupHeaderRow style to a RadGridView?  Until now, I was setting the GroupRowStyle property but as you can see from my attached picture, the styles are not applied to the new GroupRenderMode.  I see the documentation mentions that I should be working with a  "GroupHeaderRow" but I can't seem to find the property (and I'm not able to create an object of that type in Blend)

9 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 15 Dec 2012, 08:31 AM
Hello,

I am not sure how have you defined the "GridViewGroupStyle1", but I guess that the element you have targeted is not the right one. Please note that when you use the Flat Mode, you should work with GroupHeaderRow, not GridViewGroupRow.

I hope this helps.

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rob
Top achievements
Rank 1
answered on 17 Dec 2012, 01:59 PM
Hi again,

Here is the code I am attempting to use to try and create the default GroupHeaderRow style:
<UserControl
   x:Class="SilverlightApplication41.MainPage"
   Width="640" Height="480"
>
   <Grid x:Name="LayoutRoot" Background="White">
      <telerik:GroupHeaderRow />
   </Grid>
</UserControl>


If I run this project, I get the following error:

No matching constructor found on type 'Telerik.Windows.Controls.GridView.GroupHeaderRow'.
No parameterless constructor defined for this object.
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at MS.Internal.XamlManagedRuntimeRPInvokes.CreateInstance(XamlTypeToken inXamlType, XamlQualifiedObject& newObject)


0
Yoan
Telerik team
answered on 18 Dec 2012, 08:57 AM
Hi Rob,

 Actually, you can set a style for the GroupHeaderRow only implicity. Note that if you want to style a particular GridView, you can define the style in the GridView's resources. Please check the following code snippet for a reference:

<telerik:RadGridView.Resources>
 <Style  TargetType="telerik:GroupHeaderRow">
  <Setter Property="Background" Value="Red"/>
 </Style>
</telerik:RadGridView.Resources>

I hope this helps.
  Regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rodney
Top achievements
Rank 1
answered on 08 Mar 2013, 07:20 PM
Hi,,

I tried using this:
<telerik:RadGridView.Resources>
  <Style  TargetType="telerik:GroupHeaderRow">
     <Setter Property="Background" Value="Red"/>
  </Style>
</telerik:RadGridView.Resources>

But nothing happens ?! It's still the way it was before ?! 

Why?
0
Vlad
Telerik team
answered on 11 Mar 2013, 08:06 AM
Hi,

 Do you have GroupRenderMode="Flat" for your grid? 

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rodney
Top achievements
Rank 1
answered on 11 Mar 2013, 12:39 PM
Hi,

Thanks for the reply, but  yes I do !

Thanks
0
Vlad
Telerik team
answered on 11 Mar 2013, 01:08 PM
Hello,

 You can check the attached example application for reference. 

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rodney
Top achievements
Rank 1
answered on 11 Mar 2013, 01:39 PM
Hi,

Thanks for you reply.

I was able to find the answer, in my grid I use: telerik:StyleManager.Theme="Windows7", and when I put this theme, the background or any other property I put to telerik:GroupHeaderRow doesn't work! IS there a reason for that ?!

Thanks
0
Vlad
Telerik team
answered on 11 Mar 2013, 01:53 PM
Hello,

 By setting theme with the StyleManager you are actually using explicit styles and no implicit style will be applied. To achieve your goal you can use implicit styles.  

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Rob
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Rob
Top achievements
Rank 1
Yoan
Telerik team
Rodney
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or