I am having a small issue. I am creating a SPGridView on the fly within a web part and adding it to the web part with some data in it. This works fine. I have now decided to rey make it look a little funky!!
However i cannot seem to get my cssclass property to work.
I have a class in the css file
.SPGridviewsCSS th
{
background-color:#e60004;
color: Blue!important;
background-image:none;
}
.SPGridviewsCSS td
{
border-bottom-style: solid ;
border-bottom-width: 1px ;
border-bottom-color: #e60004 ;
}
and
in my oninit event
CssRegistration.Register("/Styles/Style.css");
then
myspgridview.cssclass = "SPGridviewsCSS"
all I want is it to make the grid view look good!!!
I’m using some server code for SPGridView styling. It is not very elegant solution, but it works perfectly. If you don’t have much time to find the better solution, you can use this code in your user control or aspx page, where the SPGridView control is placed:
Of course, you can use aspx markup instead of generating controls. For example:
Next thing is attach styling to header:
So, your css will be:
Hope, this helps!