ASP.NET Calendar Title Styling
The project I’m working on uses an ASP.NET calendar control for a major screen element. We hook the DayRender even and spit out some links on certain days. Our PM came to me and said we needed to make the header look better. The default settings on the calendar did not look pretty when you stretch it out to a full page. “No sweat,” I thought. I’ll just tweak some of the style tags on the control. Everything prettied up nice, except the freakin’ month text. I’d set the TitleStyle tag on the control, but nothing seemed to stick. Then I found this discussion thread via Google.
Turns out the ASP.NET Calendar control has a known bug due to where it renders all the style information for the title. IE ignores it. A quick check confirmed Firefox handled it correctly. The hack described in that forum post describes taking advantage of the fact that the header is rendered in its own table element. By setting the CssClass of the whole calendar I can then use the following CSS to tweak the title table:
.calendar TABLE TD { FONT-SIZE: large }
Caveat: This is a v1.1 project - I haven’t had the time to see if they fixed this in v2.0.
0 comments
Kick things off by filling out the form below.
Leave a Comment