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

How Do I apply a GroupPanelItemStyle?

7 Answers 90 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Henrik Skak Pedersen
Top achievements
Rank 1
Henrik Skak Pedersen asked on 11 Dec 2012, 02:26 PM
Hi,

I am trying to apply a GroupPanelItemStyle to a grid, but nothing is happening when I apply the style. I have tried something as simple as this:

<Style x:Key="GridViewGroupPanelItemStyle" TargetType="telerik:GridViewGroupPanelItem" >
    <Setter Property="Background" Value="Red" />
    <Setter Property="Foreground" Value="Green" />
</Style>


<Style x:Key="RadGridViewDefaultStyle" TargetType="telerik:RadGridView">
    <Setter Property="GroupPanelItemStyle" Value="{StaticResource GridViewGroupPanelItemStyle}" />
</Style>

 Am i missing something?

Thanks
Henrik

7 Answers, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 11 Dec 2012, 03:37 PM
Hi Henrik,

 
I would suggest you to use GridViewGroupPanelCell instead. See the code bellow:

<Style TargetType="telerik:GridViewGroupPanelCell" >
          <Setter Property="Background" Value="Red" />
          <Setter Property="Foreground" Value="Green" />
      </Style>


Greetings,
Vera
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Henrik Skak Pedersen
Top achievements
Rank 1
answered on 11 Dec 2012, 08:48 PM
Hi Vera,

Thank you very much for your reply.

Sorry but the suggested code has no effect. Even if I remove my style for the grid and only keeps this code nothings happens.

Any other ideas?

Thanks
Henrik
0
Henrik Skak Pedersen
Top achievements
Rank 1
answered on 12 Dec 2012, 09:48 AM
Just a short update, I have tried to to like below as well. But it has no effect at all. I would expect test to be written in the items.

<ControlTemplate x:Key="GridViewGroupPanelItemTemplate" TargetType="telerik:GridViewGroupPanelItem">
    <TextBlock Text="Test" />
</ControlTemplate>

<Style x:Key="GridViewGroupPanelItemStyle" TargetType="telerik:GridViewGroupPanelItem" >
    <Setter Property="Template" Value="{StaticResource GridViewGroupPanelItemTemplate}"/>
</Style>

<Style x:Key="RadGridViewDefaultStyle" TargetType="telerik:RadGridView">
    <Setter Property="GroupPanelItemStyle" Value="{StaticResource GridViewGroupPanelItemStyle}" />
</Style>
0
Ivan Ivanov
Telerik team
answered on 14 Dec 2012, 10:06 AM
Hi,

I have tested this and it seems to be working fine on my side. Would you please refer to the attached test project and tell us whether there are any relevant differences between your approach and mine.

All the best,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Henrik Skak Pedersen
Top achievements
Rank 1
answered on 14 Dec 2012, 01:18 PM
Hi Ivan,

Thank you for your reply. I have tried you example and it is working as expected. But if you add the Telerik.Windows.Themes.Windows8 assembly and add this line to App.xaml 

            Telerik.Windows.Controls.StyleManager.ApplicationTheme = new Telerik.Windows.Controls.Windows8Theme();

You will get the same behaviour as I have. The theme is overriding the style,

Any ideas?

Thanks
Henrik

0
Ivan Ivanov
Telerik team
answered on 14 Dec 2012, 01:36 PM
Hello,

Unfortunately this is not supported when a theme different from OfficeBlack is applied through the StyleManager approach. I would propose you to use our new ImplicitStyles-based theming mechanism, which overcomes a lot of former problems and is quite easier for customizations. Here is a help article on this matter.

Kind regards,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Henrik Skak Pedersen
Top achievements
Rank 1
answered on 14 Dec 2012, 02:59 PM
Ok, thank you I will try that.

Thanks
Henrik
Tags
GridView
Asked by
Henrik Skak Pedersen
Top achievements
Rank 1
Answers by
Vera
Telerik team
Henrik Skak Pedersen
Top achievements
Rank 1
Ivan Ivanov
Telerik team
Share this question
or