SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


I am trying to find the styles for the SPGridView HeaderStyle. It doesn't seem to work when i apply the following:

        spGridView.HeaderStyle.BackColor = System.Drawing.Color.Blue;
        spGridView.HeaderStyle.ForeColor = System.Drawing.Color.White;

It looks very strange. I have filtered columns and sort only columns. The sort only columns show up with no background, and the sort only columns show up somewhat okay, but they have a border where the dropdown for the filter context menu should be.

How do I fix this? See the image in this URL (I couldn't post it because I am a new user and they require i add more points):

share|improve this question
up vote 1 down vote accepted

Here is what I did, it seemed to work.

But i know its not the final answer.

<style type="text/css">
.ms-viewheadertr th{
.ms-viewheadertr .ms-vh2-gridview{


.ms-vh .ms-menuimagecell,.ms-vh2 .ms-menuimagecell,.ms-vh-icon .ms-menuimagecell{

.ms-vh .ms-menuimagecell img,.ms-vh2 .ms-menuimagecell img,.ms-vh-icon .ms-menuimagecell img{
share|improve this answer

Maybe It's not what you are looking for, I'm just sharing. I used this styles in all of my project whenever I utilize SPGridView to display data.

 Style="border-bottom-style: none; border-right-style: none; width: 100%;
        border-collapse: collapse; border-top-style: none; border-left-style: none;"
        HeaderStyle-CssClass="ms-viewheadertr" AlternatingRowStyle-CssClass="ms-itmhover"
        RowStyle-CssClass="ms-itmhover" SelectedRowStyle-CssClass="s4-itm-selected" RowStyle-Height="25"
share|improve this answer

Bill's answer worked for me.

In our application page, we need to override styles coming from Core.css which is shown in Bill's answer.

share|improve this answer
This section is for answers only – Robert Lindgren Feb 16 '15 at 10:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.