How to change GridViewColumnGroup border brush ?
I tested this :
<
Style
TargetType
=
"telerik:GridViewHeaderCell"
>
<
Setter
Property
=
"BorderBrush"
>
<
Setter.Value
>
<
SolidColorBrush
Color
=
"LightGray"
/>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"BorderThickness"
Value
=
"0,0,0,1"
/>
</
Style
>
this works for headercell. How can I do the same for ColumnGroup ?
See attached picture for exemple, I want to change the color of Red borders to lightGray.
Thanks for help.
12 Answers, 1 is accepted
You may try setting a style addressing CommonColumnHeader as TargetType, in order to achieve this. I have prepared an example project that illustrates how to achive this. It is attached for your reference.
Best wishes,
Ivan Ivanov
the Telerik team
Thanks for reply. This works well while using the default Theme. But I use the Metro Theme.
I've modified your sample project using StyleManager.Applicationtheme = new MetroTheme().
public partial class MainPage : UserControl
{
public MainPage()
{
StyleManager.ApplicationTheme = new MetroTheme();
InitializeComponent();
}
}
oops :| I can't upload a Zip file.
you can do the change to verify.
Thanks.
Any solution please ?
To address your issue and scenarios like yours in general , we have decided to add a new property to the column groups - HeaderStyle. It will be available to you in less than a week - in the very next internal build . It will also be included in the service pack coming shortly.
Regards,
Pavel Pavlov
the Telerik team
Good news, you're the best !
I found one solution... :)
I customized the Metro theme, and change the value of the borderbrush of ColumnHeader to an other resource, Build a new dll of metro theme, and I had what I were looking for.
Thanks for all.
Dear Pavel,
Can you give me a code example of HeaderStyle definition?
My second question is: How can I apply a CommonColumnHeader style to a specific GridViewColumnGroup?
I was able to create the grid as shown in current.png, but I would like the grid as shown in needed.png.
Thank you in advance,
Sergey Borodetsky
I am afraid the current version of RadGridView does not support row spanning for common headers.
Greetings,
Pavel Pavlov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Can I apply a CommonColumnHeader style to a specific GridViewColumnGroup?
Best regards,
Sergey Borodetsky
You may use the HeaderStyle property of GridViewColumnGroup to achieve your goal:
<
Grid
>
<
Grid.Resources
>
<
Style
x:Key
=
"s1"
TargetType
=
"telerik:CommonColumnHeader"
>
<
Setter
Property
=
"Background"
Value
=
"Red"
/>
</
Style
>
</
Grid.Resources
>
<
telerik:RadGridView
x:Name
=
"list"
>
<
telerik:RadGridView.ColumnGroups
>
<
telerik:GridViewColumnGroup
HeaderStyle
=
"{StaticResource s1}"
Name
=
"VehicleInfo"
Header
=
"Vehicle info"
/>
<
telerik:GridViewColumnGroup
Name
=
"Dimensions"
Header
=
"Dimensions"
/>
</
telerik:RadGridView.ColumnGroups
>
.....
</
telerik:RadGridView
>
Greetings,
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
why a project for each question? Sometime we have to do something and resources from your site is very useful but download and run a project for simple replies are very time consuming where a copy\paste save a lot of working time.
Thanks
Hi,
Can we do Row Spanning for common headers now?
Thanks in advance.
Balaji
Hi Balaji,
Row spanning for common headers is still not supported by the RadGridView control. We have to not planned such improvements at the moment but you can log a feature request in our Feedback Portal and if it gathers enough votes we can implement it.
Regards,
Dinko
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.