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
Any updates on this??
shinu
Orion systems india
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,
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.
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 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.
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.
<telerikGrid:GridViewImageColumn ImageHeight="20" ImageWidth="20" DataMemberBinding="{Binding Path=AssetType,Converter={StaticResource ImagePathConverter}}" Width="Auto"> |
</telerikGrid:GridViewImageColumn> |
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.
<DataTemplate> |
<TextBlock Background="Black" Foreground="White" Text="{Binding AssetType}" Width="30"></TextBlock> |
</DataTemplate> |
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.
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 !
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.
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.
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.
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
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?
Vanya Pavlova
the Telerik team
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.
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.
Vanya Pavlova
the Telerik team