Background color of a DataSheet view
Filed Under (SharePoint, css) by Boris Gomiunik on 25-02-2009
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;
}
New CSS
body{
background-color:#FFF;
}
form#aspnetForm {
background-color: #707070;
height: 100%; /*cover all the background*/
}
produced proper DataSheet view









































Hi,
Can you apply conditional formatting to datasheet view, e.g. change the background color of one row based on the value in one field.
Wow, saved my life! I had dark blue background on a Project site
This doesnt always work. Depending how its structured you may just have to rely on setting the background color of the page instead of using the form#aspnetForm class. Just use .body { background-color: #FFF; } instead if the #aspnetForm doesnt work.
Sorry to be such a retard but which css file do I add this code to?
Hi, Tom! On any CSS that the SharePoint loads. If you’re using a theme and want to customize it by editing the site with SharePoint Designer, look for folder “_Themes” in your site. In that folder is a folder named by the selected theme (for example theme Jet has a folder JET). In this folder look for a similar named CSS file (JET….css). this is the one that SharePoint reads.
Otherwise if you’re creating your own theme, it would be advisable to do this in theme.css.
[...] I found this extremely useful tip here. [...]