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

Different theme for a nested gridview

2 Answers 132 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Perlom
Top achievements
Rank 1
Perlom asked on 17 Oct 2011, 08:31 PM

Hi,

 

I have a gridview that is themed with Telerik Windows 7 theme, which is the general theme of the application and gets set at load time.  I want to add another grid in the Row Details section, however I want this nested grid to have a different theme for clarity (office black, or the white theme from the WPF Telerik examples).  Unfortunately, the nested gridview always take the same theme as the parent one.  I have tried to set the style differently, but it didn’t work.

 

 

<Style x:Key="RowDetailGridViewStyle" TargetType="{x:Type Controls:RmpReadOnlyGridView}"  BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Office_SilverTheme, ElementType=telerik:RadGridView}}">


 

Any suggestion what I should do?

 

Regards

2 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 18 Oct 2011, 08:36 AM
Hi Perlom,

 


Once you set the Windows7 theme as an application theme you may try to manually set the theme for the grid in the corresponding row details, something like the following:


<Window.Resources>
    <DataTemplate x:Key="dt">
        <telerik:RadGridView telerik:StyleManager.Theme="Expression_Dark" ItemsSource="{Binding Collection}"/>
        </DataTemplate>
    </Window.Resources>
    <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource SampleDataSource}}">
        <telerik:RadGridView RowDetailsTemplate="{StaticResource dt}"  RowDetailsVisibilityMode="Visible"   ItemsSource="{Binding Collection}"/>
    </Grid>


When you run the application you may see that the grids are with different theme. 


Kind regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Perlom
Top achievements
Rank 1
answered on 18 Oct 2011, 06:18 PM
Thanks Vanya, that worked :)

Cheers
Tags
GridView
Asked by
Perlom
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Perlom
Top achievements
Rank 1
Share this question
or