views:

245

answers:

5

Trying to CSS it, I can CSS the cells, and the days of the week, and I think the top part that says the month, but the area around the month is silver, and no attempt at cssing it will change it - I tried all the different Css properties (I think) but it always ends up being silver. It appears in the designer as silver too. I can't find a way to change this...ideas?

A: 

The rendered HTML for the calendar control will probably contain an inline style definition by default e.g style="background-color: silver;", which will take precedence over CSS declarations unless they have the !important flag.

You could change this in the markup for the calendar control as a quick fix

<asp:Calendar id="cal1" runat="server">
    <TitleStyle CssClass="classname" />
</asp:Calendar>
Phil Jenkins
It seems that the Css is ignored, as setting background-color in the Css does nothing, but setting it inline works.
SLC
A: 

Try using IE Developer toolbar/Firebug + Firefox, and hover over the item that you want to change the color of. See if writing CSS for that items works.

Rahul Soni
A: 

Unfortunately, this style is actually hard-coded into the Render method of the original ASP.NET Calendar object. You can use Reflector to see this. Yes, it's ridiculous. Use an alternative calendar object, or sublclass the calendar and fix the Render method. Not sure if this is fixed in 3.5...

Bryan
I ended up doing it inline, lets hope the people that did that get a poke in the eye for the next release...
SLC
A: 

Just add this in the ASPX of your control:

TitleStyle-BackColor="Transparent"

That should solve the problem.

Marco
A: 

Marco - your a legend! That is the only thing I could get to work for me. You saved me a massive headache. THANKS! Gary

Gary