RadGridView Header BackGroundColor

13 posts, 0 answers
  1. Mehmet
    Mehmet avatar
    33 posts
    Member since:
    Jul 2010

    Posted 29 Jul 2012 Link to this post

    Hi,

    I changed RadGridView BackGroundColor with some XAML codes.
    But I couldn't change first header column, as the picture Image.
    What should I do?

    Mehmet,
    Regards

     My code;
     <LinearGradientBrush x:Key="a1" StartPoint="0.5,0" EndPoint="0.5,0.5">
                <GradientStop Offset="1" Color="Gray" />
                <GradientStop Offset="0" Color="#FFD8D8D8" />
            </LinearGradientBrush>
            <SolidColorBrush x:Key="GridView_HeaderOuterBorder" Color="#FF848484"/>
            <Style TargetType="telerik:GridViewHeaderRow">
                <Setter Property="Background" Value="{StaticResource a1}"/>
            </Style>
            <Style TargetType="telerik:GridViewHeaderCell">
                <Setter Property="Background" Value="{StaticResource a1}"/>
            </Style>
            <Style TargetType="telerik:GridViewAggregateResultCell">
                <Setter Property="Background" Value="{StaticResource a1}"/>
            </Style>

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 30 Jul 2012 Link to this post

    Hello,

    The first part for the header row is presented by the "Part_IndicatorPresenter" border. Please check the visual structure for the indent cells of the GridView and style all the relevant elements.

    All the best,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Mehmet
    Mehmet avatar
    33 posts
    Member since:
    Jul 2010

    Posted 30 Jul 2012 Link to this post

    Hi Didie,

    I tried again
    but I can't change this section. 
    I'm sending my problem as the picture Image.

    Allt the best
    Mehmet
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 30 Jul 2012 Link to this post

    Hi,

     The element that you have marked  is "GridViewHeaderIndentCell". To change its Background you should create a simple style targeting this element.

    <Style TargetType="{x:Type GridViewHeaderIndentCell}">
       <Setter Property="Background" Value="{StaticResource a1}"/>
    </Style>


    All the best,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Mehmet
    Mehmet avatar
    33 posts
    Member since:
    Jul 2010

    Posted 30 Jul 2012 Link to this post

    Hi Didie ,

    note: I used hieararchy a grid. I sent you as the first Image,
    at the same time, Your example maybe WPF "x:Type"?

    I tried before this element, but problem has not changed.

    <Style TargetType="telerik:GridViewHeaderIndentCell">
       <Setter Property="Background" Value="{StaticResource a1}"/>
    </Style>

    your code;

    <Style TargetType="{x:Type GridViewHeaderIndentCell}">
    <Setter Property="Background" Value="{StaticResource a1}"/>
    </Style>

     

    All the best,
    Mehmet

  7. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 30 Jul 2012 Link to this post

    Hello,

     Indeed, you are right - my code snippet was for WPF. Please excuse me for my mistake.

    It seems that you cannot change the Background with a simple style as it is internally set to be the "GridView_HeaderRowBackground". You have to edit the template of GridViewHeaderIndentCell directly and change its background from there. Please give it a try and let me know if you will need a sample project?

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Mehmet
    Mehmet avatar
    33 posts
    Member since:
    Jul 2010

    Posted 30 Jul 2012 Link to this post

    Hi Didie ,

    Yes please, I need a sample project.

    Thanks
    Mehmet
  9. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 30 Jul 2012 Link to this post

    Hi,

     I have discussed the case with our front-end developer and I have some very good news. The problem with setting the Background in a simple style has been resolved. The fix will be available within the latest internal build that is expected to be released later today. 

    Then this code will colour the HeaderIndentCell Pink:

    <Style TargetType="telerik:GridViewHeaderIndentCell">
        <Setter Property="Background" Value="Pink"/>
    </Style>

    Please wait for the LIB and let me know about the results once you test it.
     

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  10. Richard
    Richard avatar
    5 posts
    Member since:
    Dec 2013

    Posted 22 Dec 2014 in reply to Dimitrina Link to this post

    Hello Dimitrina,
    I am familiar with your answer of Style and TargetType but I don't understand how to access that "indent" in (WPF) XAML. I use a similar style to change the column header backgrounds.

    This changes the column headers but not the "indent"...

                  <telerik:GridViewDataColumn Header="Updated By" DataMemberBinding="{Binding Property.UpdatedBy}"       HeaderCellStyle="{StaticResource HeaderStyle}" Width="200" TextAlignment="Left" />
                  

    How do I change the indent column header background???

    Thank you,
    Richard Howes

  11. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 23 Dec 2014 Link to this post

    Hello Richard,


    Thank you for contacting us.

    You may define an implicit style targeted at GridViewHeaderIndentCell, as proposed in our online documentation here. 


    Regards,
    Vanya Pavlova
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  12. Richard
    Richard avatar
    5 posts
    Member since:
    Dec 2013

    Posted 23 Dec 2014 in reply to Vanya Pavlova Link to this post

    Thank you. 
  13. Richard
    Richard avatar
    5 posts
    Member since:
    Dec 2013

    Posted 23 Dec 2014 in reply to Richard Link to this post

    I don't have access to Blend. What does the XAML look like that is chopped off in that image? Thanks again!
  14. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 23 Dec 2014 Link to this post

    Hello Richard,


    You could check the XAML mark-up, referred by my colleague, here. 


    Regards,
    Vanya Pavlova
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner