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

Changing border color in the GridRowHeader empty space after the columns

3 Answers 288 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 24 Aug 2011, 09:23 PM
We are using a RadGridView and we have 2 columns and the empty space to the right of the header columns has this white border color that I'm not finding a way to remove it by styling or control templating.

In styling I've tried:

<Style TargetType="{x:Type telerikGridView:RadGridView}">
    <Setter Property="telerikControls:StyleManager.Theme" Value="Transparent"/>
    <Setter Property="HeaderRowStyle">
        <Setter.Value>
            <Style TargetType="{x:Type Control}">
                <Setter Property="Background" Value="{DynamicResource GridHeaderBrush}"/>
                <Setter Property="BorderThickness" Value="0,0,0,0"/>
            </Style>
        </Setter.Value>
    </Setter>
</Style>

I've also tried re-templating the control and doing the following:

<telerik:GridViewScrollViewer.HeaderRow>
    <telerik:GridViewHeaderRow x:Name="PART_HeaderRow" IsTabStop="False" IndentLevel="{TemplateBinding GroupCount}" Background="{DynamicResource GridHeaderBrush}" BorderThickness="0,0,0,0" BorderBrush="Transparent">
    </telerik:GridViewHeaderRow>
</telerik:GridViewScrollViewer.HeaderRow>

There still remains a white border around the empty space where the header column cells don't occupy. When I inspect the visual tree via WPF Snoop I see the white border belongs to a Border visual that is in the visual tree however when I copy the control template in Blend so I can edit it I don't see this border anywhere. Is this border being added by code instead of XAML?

I would appreciate any help on changing this border color.

Thanks

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 25 Aug 2011, 09:57 AM
Hi Simon,

 
I am not quite sure that I understand you requirement correctly. If you want to predefine the template of GridViewHeaderRow you may use Blend and modify it from there as it is described in our docs. 
However I am not quite sure how this fits in your case.
Will you please provide a bit more details about the desired final result?



Best wishes,
Vanya Pavlova
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Simon
Top achievements
Rank 1
answered on 25 Aug 2011, 04:03 PM
Thanks for the reply Vanya,

Take a look at this screenshot:
http://dl.dropbox.com/u/35981972/Pictures/radgridview-01.png

Notice the empty space to the right has a white border. I've narrowed down the border coming from these 2 borders highlighted from WPF Inspector:
http://dl.dropbox.com/u/35981972/Pictures/wpfinspector-01.png

I imagine part of my problem is I'm not able to properly template the control in Blend for some reason. When I right click on the RadGridView in Blend and do a Edit Template - Edit a Copy I don't see any header row elements that match WPF Inspector's visual tree it shows for the control. This is what I see:
http://dl.dropbox.com/u/35981972/Pictures/blend-01.png

Any help would be greatly appreciated. In WPF Inspector of I modify the border sizes on the 2 highlighted borders I mentioned I get the desired result. Now I just have to figure out how to get there with XAML :)

Thanks for the help!

0
Accepted
Vanya Pavlova
Telerik team
answered on 25 Aug 2011, 04:13 PM
Hello Simon,

 

Thank you for getting back to us! Unfortunately we have some issues related to the Blend support for RadGridView/WPF. I'll recommend you to use the following approach:

1.Find in Assets library a single GridViewHeaderRow.
2.Drag it onto the Artboard, right click on it and choose the option Edit Template -> Edit a copy.


You may use the same approach for any other RadGridView's part.
Regarding your question I believe that you have to modify the Background/BorderBrush properties of GridViewHeaderRow. 
You may do this even with a simple style targeted at GridViewHeaderRow. On the other hand if you want to modify its inner border you have to predefine its template using Expression Blend.
Please give it a try and let me know how it goes.


Kind regards,
Vanya Pavlova
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
Simon
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Simon
Top achievements
Rank 1
Share this question
or