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

How to style full column headers bar?

2 Answers 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joan
Top achievements
Rank 1
Joan asked on 03 Feb 2012, 04:49 PM
Hello,

Right now my grid is as this image shows: http://j.mp/xyQpwB, but I want to apply the color to all the "black bar".

I have the following code:

<Window x:Class="WpfApplication2.MainWindow"
        Title="MainWindow"
        Height="350"
        Width="525"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Window.Resources>
        <SolidColorBrush x:Key="GridView_HeaderBackground"  Color="LightBlue" />
        <Style TargetType="telerik:GridViewHeaderCell">
            <Setter Property="Background" Value="{StaticResource GridView_HeaderBackground}"/>
        </Style>
    </Window.Resources>
    <Grid>
        <telerik:RadGridView
            Name="radGridView1"
            ShowGroupPanel="False"
            RowIndicatorVisibility="Collapsed"
            >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn
                    Header="One"
                    Width="100"
                    />
            </telerik:RadGridView.Columns>         
        </telerik:RadGridView>
    </Grid>
</Window>

How can I achieve this?

Thanks,
Joan

2 Answers, 1 is accepted

Sort by
0
Joan
Top achievements
Rank 1
answered on 03 Feb 2012, 05:04 PM
Adding a "void column" solved it.

<telerik:RadGridView.Columns>
    <telerik:GridViewDataColumn
        Header="One"
        Width="100"
    />
    <telerik:GridViewDataColumn
        Header=""
        Width="*"
    />
</telerik:RadGridView.Columns>

Is there a way to stop drawing the Grid at the last visible column, in order to not to show the rest of the bar?
0
Joan
Top achievements
Rank 1
answered on 08 Feb 2012, 11:15 AM
Well after some testing, adding a void column doens't solve the problem if you want to fit the columns to the grid.

I am using the solution provided at I am using the solution provided here to set the width to all columns.

The problem is when a column is set to IsVisible false, the default black bar appears to the right.

Is there a way to style that bar?
Is there a way to know when a column changes its visibility?
Tags
GridView
Asked by
Joan
Top achievements
Rank 1
Answers by
Joan
Top achievements
Rank 1
Share this question
or