Background color of a DataSheet view

February 25th, 2009 | Categories: css, SharePoint

I was stuck with a problem the other day when I was creating a custom theme for SharePoint. My DataSheet view was with dark background and I couldn’t find CSS class or element to be able to manipulate it.

Turns out that the DataSheet ActiveX is taking the body background color – which was also dark in my theme. Fixing this resolved the issue. But to be able to use the dark body background, apply the background to the form element.

Old CSS:

body{
    background-color:#707070;
}

Produced the DataSheet View
image

New CSS

body{
    background-color:#FFF;
}
form#aspnetForm {
    background-color: #707070;
    height: 100%; /*cover all the background*/
}

produced proper DataSheet view

image