Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

All,

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

http://spgridview.com/files/2-26-2012%2011-57-51%20PM.png

share|improve this question
add comment

2 Answers

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;"
        CssClass="ms-listviewtable"
        HeaderStyle-CssClass="ms-viewheadertr" AlternatingRowStyle-CssClass="ms-itmhover"
        RowStyle-CssClass="ms-itmhover" SelectedRowStyle-CssClass="s4-itm-selected" RowStyle-Height="25"
share|improve this answer
add comment

Here is what I did, it seemed to work.

But i know its not the final answer.

<style type="text/css">
.ms-viewheadertr th{
padding-top:0px;
background-color:#2878C0;
color:White;
}
.ms-viewheadertr .ms-vh2-gridview{
height:auto;
background-color:#2878C0;
color:White;
}

.ms-menuimagecell{
border:0px;
}

.ms-vh .ms-menuimagecell,.ms-vh2 .ms-menuimagecell,.ms-vh-icon .ms-menuimagecell{
border:0px;
}

.ms-vh .ms-menuimagecell img,.ms-vh2 .ms-menuimagecell img,.ms-vh-icon .ms-menuimagecell img{
border:0px;
}
</style>
share|improve this answer
add comment

Your Answer

 
discard

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.