Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > GridView > How to style full column headers bar?

Not answered How to style full column headers bar?

Feed from this thread
  • Joan avatar

    Posted on Feb 3, 2012 (permalink)

    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

    Reply

  • Joan avatar

    Posted on Feb 3, 2012 (permalink)

    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?

    Reply

  • Joan avatar

    Posted on Feb 8, 2012 (permalink)

    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?

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > GridView > How to style full column headers bar?
Related resources for "How to style full column headers bar?"

WPF Grid Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]