Background color of a DataSheet view
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.
How to format datasheet view in Sharepoint? I have some editable and non-editable columns there and want to distinguish them with colours. How can I do that??
Similarly there is a totals row, which is calculating subtotals of the columns? How can I chnage the colourof the row (Background as well as text colour)?
You solved a problem I’m thinking about for days within a few seconds – many thanks!
I just changed body{
background-color:#707070;
}
to
body{
background-color:#FFFFFF;
}
and it works great. Thank you for the info.
This is brillilant information, thanks !
Thanks! You’re a life saver!