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

How to style GridViewColumnGroup ?

12 Answers 595 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 01 Dec 2011, 10:10 AM
Hi,

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

Sort by
0
Ivan Ivanov
Telerik team
answered on 01 Dec 2011, 02:19 PM
Hello Radouan,

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
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Mike
Top achievements
Rank 1
answered on 01 Dec 2011, 03:19 PM
Hello Ivan,

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.

0
Mike
Top achievements
Rank 1
answered on 01 Dec 2011, 03:51 PM
I thank that because this value is depending on the value of MetroColors.PaletteInstance.AccentColor. The probleme for me is that I've already set this value to red color and I can't change it (for ergonomy reasons).

Any solution please ?
0
Pavel Pavlov
Telerik team
answered on 05 Dec 2011, 05:02 PM
Hello Radouan,

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
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Mike
Top achievements
Rank 1
answered on 05 Dec 2011, 05:09 PM
Hello Pavel,

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.

0
Sergey
Top achievements
Rank 1
answered on 02 May 2012, 07:42 PM

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

0
Pavel Pavlov
Telerik team
answered on 03 May 2012, 09:10 AM
Hello Sergey,

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 >>

0
Sergey
Top achievements
Rank 1
answered on 03 May 2012, 07:41 PM
Dear Pavel,
Can I apply a CommonColumnHeader style to a specific GridViewColumnGroup?

Best regards,
Sergey Borodetsky
0
Vanya Pavlova
Telerik team
answered on 04 May 2012, 08:55 AM
Hello Sergey,

 

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 >>

0
Maurizio
Top achievements
Rank 1
answered on 15 Jul 2013, 06:52 AM
Hi,

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
0
Balaji
Top achievements
Rank 1
answered on 20 Mar 2020, 03:24 PM

Hi,

Can we do Row Spanning for common headers now?

 

Thanks in advance.

Balaji

0
Dinko | Tech Support Engineer
Telerik team
answered on 25 Mar 2020, 09:45 AM

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

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
GridView
Asked by
Mike
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Mike
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Sergey
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Maurizio
Top achievements
Rank 1
Balaji
Top achievements
Rank 1
Dinko | Tech Support Engineer
Telerik team
Share this question
or