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

Applying a style to GridViewIndentCell not working

5 Answers 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dave Aronow
Top achievements
Rank 1
Dave Aronow asked on 07 Mar 2012, 03:26 PM
I am trying to make the radGridView GridViewIndentCell background match the background of the row itself (White) and based on a sample I found in the forums I applied the following in the XAML (see below). In Expression Blend this appears to work as it does appear correctly in the design preview with the white background applied.  In Visual Studio 2010 ReSharper grays it out saying it is never used but in the design preview of the grid does apply the background.  However when I deploy the code it doesn't work and I get the themed background.  

Is there some other way to apply this background?
Thanks.
Dave

<UserControl.Resources>
        <Style TargetType="telerik:GridViewIndentCell" >
            <Setter Property="Background" Value="White"/>
        </Style>
</UserControl.Resources>

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 08 Mar 2012, 04:15 PM
Hello,

 Indeed this is the style that should be applied. Would you please let me know if you have applied some theme different from the default one? If yes, then can you please give us details about that theme? It would be even better if you could send us a simple project showing your case.

All the best,
Didie
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Dave Aronow
Top achievements
Rank 1
answered on 08 Mar 2012, 05:59 PM
I am applying the Windows 7 theme for the whole page using the method I found somewhere on the telerik site:

StyleManager.ApplicationTheme = new Windows7Theme();

This is the first line executed in the constructor of my main page.  I tried removing it, now the theme is gone (the default theme is back) but that cell is still filled in (just in a different color).  
0
Dimitrina
Telerik team
answered on 13 Mar 2012, 07:41 AM
Hi,

 Thank you for that additional information. We have investigated this issue and I can confirm it as a bug. 
As a workaround you can try to create your custom theme as explained in this help article.

Greetings,
Didie
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Dave Aronow
Top achievements
Rank 1
answered on 13 Mar 2012, 01:06 PM
Before I head down that road would it be possible to workaround the bug by applying the style in code in say the onload event of the page or a different event when the grid is bound?  Without knowing where the bug is I don't want to waste time trying these if they are guaranteed to fail....

Thanks.
Dave
0
Dimitrina
Telerik team
answered on 14 Mar 2012, 09:19 AM
Hello Dave,

 Unfortunately you cannot apply this style after the rows are loaded.  When you create a custom theme, then you can set your own style for the GridViewIndentCell. Now your defined style is overridden by the  style defined inside the Windows7 Theme.

Regards,
Didie
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
GridView
Asked by
Dave Aronow
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Dave Aronow
Top achievements
Rank 1
Share this question
or