Applying a style to GridViewIndentCell not working

6 posts, 0 answers
  1. Dave Aronow
    Dave Aronow avatar
    7 posts
    Member since:
    Sep 2011

    Posted 07 Mar 2012 Link to this post

    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>
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 08 Mar 2012 Link to this post

    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 >>
  3. Dave Aronow
    Dave Aronow avatar
    7 posts
    Member since:
    Sep 2011

    Posted 08 Mar 2012 Link to this post

    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).  
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 13 Mar 2012 Link to this post

    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 >>
  5. Dave Aronow
    Dave Aronow avatar
    7 posts
    Member since:
    Sep 2011

    Posted 13 Mar 2012 Link to this post

    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
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 14 Mar 2012 Link to this post

    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 >>
Back to Top