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

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

17 Answers 345 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raj A R
Top achievements
Rank 1
Raj A R asked on 05 Jan 2010, 07:34 AM
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

17 Answers, 1 is accepted

Sort by
0
Raj A R
Top achievements
Rank 1
answered on 05 Jan 2010, 02:43 PM
Hi team,
Any updates on this??

shinu
Orion systems india
0
Tsvyatko
Telerik team
answered on 06 Jan 2010, 12:32 PM
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.
0
Raj A R
Top achievements
Rank 1
answered on 06 Jan 2010, 01:28 PM
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.
0
Tsvyatko
Telerik team
answered on 08 Jan 2010, 04:14 PM
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.
0
jimit r
Top achievements
Rank 1
answered on 22 Feb 2010, 07:26 AM
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?
0
Vlad
Telerik team
answered on 22 Feb 2010, 07:33 AM
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.
0
jimit r
Top achievements
Rank 1
answered on 24 Feb 2010, 12:46 PM
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?
0
Hristo
Telerik team
answered on 01 Mar 2010, 12:34 PM
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.
0
Marc Roussel
Top achievements
Rank 2
answered on 01 Mar 2010, 02:58 PM
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 !
0
Kalin Milanov
Telerik team
answered on 02 Mar 2010, 10:29 AM
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.
0
Marc Roussel
Top achievements
Rank 2
answered on 02 Mar 2010, 11:05 AM
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.
0
Vlad
Telerik team
answered on 05 Mar 2010, 07:56 AM
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.
0
Marc Roussel
Top achievements
Rank 2
answered on 05 Mar 2010, 11:15 PM
Could you just show us a little example ?
0
Dmitry
Top achievements
Rank 1
answered on 04 Mar 2011, 12:49 PM
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
0
Vanya Pavlova
Telerik team
answered on 04 Mar 2011, 04:07 PM
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!
0
Dmitry
Top achievements
Rank 1
answered on 04 Mar 2011, 05:16 PM
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.



0
Vanya Pavlova
Telerik team
answered on 07 Mar 2011, 08:13 AM
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!
Tags
GridView
Asked by
Raj A R
Top achievements
Rank 1
Answers by
Raj A R
Top achievements
Rank 1
Tsvyatko
Telerik team
jimit r
Top achievements
Rank 1
Vlad
Telerik team
Hristo
Telerik team
Marc Roussel
Top achievements
Rank 2
Kalin Milanov
Telerik team
Dmitry
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or