Need to change the groupbar color ,selected row color and header font to normal

18 posts, 0 answers
  1. Raj A R
    Raj A R avatar
    31 posts
    Member since:
    Oct 2009

    Posted 05 Jan 2010 Link to this post

    Hi team,

    I Need to change the groupbar color ,selected row color and header font to normal , currently am using the black theme.
    please see attached screen shot of my grid

    -shinu
    orion india systems
  2. Raj A R
    Raj A R avatar
    31 posts
    Member since:
    Oct 2009

    Posted 05 Jan 2010 Link to this post

    Hi team,
    Any updates on this??

    shinu
    Orion systems india
  3. DevCraft banner
  4. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 06 Jan 2010 Link to this post

    Hello Raj A R,

    You can customize  Column header font weight using GridViewHeaderCell style for each column and setting fontweight property, like:
    <Style x:Key="CustomHeaderCellStyle" TargetType="grid:GridViewHeaderCell">
        <Setter Property="FontWeight" Value="Normal" />
    </Style>

    To customize Group header you can use grid GroupRowStyle:
    <Style x:Key="CustomGridViewGroupRowStyle" TargetType="grid:GridViewGroupRow">
        <Setter Property="Background" Value="LightBlue"/>
    </Style>

    To customize selected row color you need to customize the Grid RowStyle and modify the template by changing the follwing line with the desired color:
    <Rectangle x:Name="BackgroundRectangle" Fill="{StaticResource GridViewRowSelectedBackground}" Opacity="0" Grid.Column="2" Grid.ColumnSpan="2"/>

    Hope this helps.

    Sincerely yours,
    Author Tsvyatko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Raj A R
    Raj A R avatar
    31 posts
    Member since:
    Oct 2009

    Posted 06 Jan 2010 Link to this post

    Hi Tsvyatkothe ,
    I have added the following code to make the groupheader color to lightblue and group header font normal,
    but it is not making any difference . the group header font is still Bold but the grouped rows font changes to normal.
    I need to make groupheader font  normal.
    <RadGrid:RadGridView                                                   x:Name="rgvFSCSA" 
                                                     ItemsSource="{Binding GridDataSource, Mode=TwoWay}">  
                                    <RadGrid:RadGridView.GroupRowStyle> 
                                        <Style TargetType="RadGridView:GridViewGroupRow" > 
                                            <Setter Property="FontWeight" 
                                                    Value="Normal" /> 
                                            <Setter Property="Background" 
                                                    Value="LightBlue" /> 
                                        </Style> 
                                    </RadGrid:RadGridView.GroupRowStyle> 
    Also i would like to know how i can give selected row color by directly setting style inside the radgrid tag , instead of changing the theme styles. I mean i need to override the theme styles in the xaml,

    Also i tried the following code , but it is not making all the groupheader parts to Blue, some Orange color r still there.

    <

     

    Style x:Key="GridViewGroupRowStyle" TargetType="Telerik_Windows_Controls_GridView:GridViewGroupRow">

     

     

     

    <Setter Property="Template" Value="{StaticResource GridViewGroupRowTemplate}"/>

     

     

     

    <Setter Property="Background" Value="Blue"/>

     

     

     

    </Style>

     


    PLease see the attached image

    -shinu
    orion india systems.
  6. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 08 Jan 2010 Link to this post

    Hello Raj A R,

    Please check the attached example. It demonstrates how to customize grid Header, GroupHeader and Rows.

    I have included comments explaining the templates of the different gridview parts used for the customization.

    If you have any more questions do not hesitate to contact us.



    Greetings,
    Tsvyatko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. jimit r
    jimit r avatar
    12 posts
    Member since:
    Dec 2009

    Posted 22 Feb 2010 Link to this post

    Hey Raj A R / Telerik team !!

    I need to know how i can change the text that is displayed in the group row header.

    <telerikGrid:GridViewImageColumn  ImageHeight="20" ImageWidth="20" DataMemberBinding="{Binding Path=AssetType,Converter={StaticResource ImagePathConverter}}" Width="Auto"
     
    </telerikGrid:GridViewImageColumn> 



    When i group my data according to the details in this column, the group row headers display the full path of the image source.


    What property should i set in the style of the GridViewGroupRow to display my own content?
  8. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 22 Feb 2010 Link to this post

    Hi jimit r,

    You can use GroupHeaderTemplate to define your own template.

    Best wishes,
    Vlad
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  9. jimit r
    jimit r avatar
    12 posts
    Member since:
    Dec 2009

    Posted 24 Feb 2010 Link to this post

    Hi Vlad,

    I have the following column in my RadGridView:


    1
    1
    1
    1
    1
    2
    2
    2
    2
    2
    3
    3
    3
    3
    3
    4
    4
    4


    The column gets its data from a particular column of a List in code-behind. 
    If i write the following data template: will each group header display the numbers one by one?

    <DataTemplate> 
    <TextBlock Background="Black" Foreground="White" Text="{Binding AssetType}" Width="30"></TextBlock> 
    </DataTemplate> 


    For me the header remains blank.

    Also, why am i not able to find a link on your site to create my own thread?
  10. Hristo
    Admin
    Hristo avatar
    408 posts

    Posted 01 Mar 2010 Link to this post

    Hi jimit r,

    Please use this link to open a separate forum thread for your question or open a support ticket here.

    Greetings,
    Hristo
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  11. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 01 Mar 2010 Link to this post

    For changing the Column Header font.  Is there any example on how to do things using Blend 3 ?
    I just want to change the font parameters of the columns header.
    Or by C# code if it's possible.  In either way,  I never do xaml by hand and I'm sure I'm not alone.

    Thank you very much !
  12. Kalin Milanov
    Admin
    Kalin Milanov avatar
    447 posts

    Posted 02 Mar 2010 Link to this post

    Hello Marc Roussel,

    To set a font for the header cell you will need to define a style and set the style there. Attached I am sending you a sample (created entirely in Blend 3) which achieves that.

    Regards,
    Kalin Milanov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  13. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 02 Mar 2010 Link to this post

    Oh sorry.  Now I see how you do it in Blend 3 but I tought that I could do it just for the header but as soon as I saw that you have to add a Column in the column collection, this made me thing, oh wait, I can't do it that way since I'm adding my columns at runtime so
    the question now is how do you change this by C# code without adding any columns or at least, by adding my new column I presume I have to do a CellStyle by C# code byt I don't know how to do it.
  14. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Mar 2010 Link to this post

    Hello Marc,

    You can assign desired HeaderCellStyle for desired column in the same way runtime.

    Regards,
    Vlad
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  15. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 05 Mar 2010 Link to this post

    Could you just show us a little example ?
  16. Dmitry
    Dmitry avatar
    2 posts
    Member since:
    Mar 2011

    Posted 04 Mar 2011 Link to this post

    Hi Team!

    I use the code example from the Posted on Jan 8, 2010:  http://www.telerik.com/ClientsFiles/167861_silverlightapplication.zip for the subject manipulation. It works correct but we bought and use latest version (q3) of  the RadGridView control. The problem is this version of control does not have a RowStyleSelector feature but out control does! So when I use this example code I loose that feature.

    Could you please show me what I have to change (or some thing else) for correct  q3-RadGridView  control.


    Dmitry, thank you
  17. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 04 Mar 2011 Link to this post

    Hello Dmitry,

    The referred example demonstrates how to modify the default styles of different parts of RadGridView such as GridViewRow, GridViewCell, GridViewHeaderCell. Can you please elaborate a little more on your scenario?
    Do you need to apply some conditional styling in RadGridView or maybe I am missing something? 


    All the best,
    Vanya Pavlova
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  18. Dmitry
    Dmitry avatar
    2 posts
    Member since:
    Mar 2011

    Posted 04 Mar 2011 Link to this post

    Hello Vanya,

    The scenario is very simple.
    I use the example styles as you said:

    <CommonCtrls:RadGridView Name="Summary" AutoGenerateColumns="False" ItemsSource="{Binding Requests}"
                               ShowGroupPanel="False" IsFilteringAllowed="False" SelectionMode="Extended"
                               RowIndicatorVisibility="Collapsed" CanUserReorderColumns="False"
                               EditTriggers="CellClick"
                               RowStyleSelector="{StaticResource styleSelector}"
                               RowStyle="{StaticResource CustomGridViewRowStyle}">

    Where CustomGridViewRowStyle - the example style

    The I use RowStyleSelector for change a row background in a some cases.
    Note! I defined the RowStyleSelector, but code of the styleSelector is never invoked. When I remove the RowStyle definition  - it's ok (styleSelector works - changes a row background).

    I've found out the version of example RadGridView doesn't have RowStyleSelector (our q3-version  does, as I said already), so clear In my case. It seems to me I have to change something into row template and style for actual q3-version.

    The question is: what's I have to change?

    Thanks for your answer.



  19. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 07 Mar 2011 Link to this post

    Hello Dmitry,

     

    Thank you for sharing this information with us. Indeed this behavior is the expected one. You cannot combine RowStyle and RowStyleSelector in a single grid, because the RowStyle always takes precedence and the RowStyleSelector would not be applied. I may suggest you to use only a single StyleSelector in this case.

    Best wishes,
    Vanya Pavlova
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top
DevCraft banner