Handling styles in your custom control
Note: this entry has moved.
My previous post didn’t stress enough the main point I was trying to make (I should have entitled it differently I believe). I’m posting again, this time hoping to make it clear.
I already know you can write all kind of hacks (as Cazzu and Jason have suggested in the comments) to actually make the Calendar output the styles you want. But the intention of my previous post was not exactly to show how to overcome Calendar’s current bugs. Note that I didn’t even mentioned the approach we finally took to replace the background color of each day’s cell, which –btw– didn’t required a single line of code (bets are open…).
I was far more interested in showing what the Calendar was doing wrong with the hope that all controls developers out there could learn from this and avoid such a mistake when coding their own controls. So, let’s recap, what was the lesson learned from looking at Calendar’s inner workings?
Never, ever, ever, apply any default styles if a CssClass is specified (you know you don’t want to override the page developer settings with your own defaults).
(Does the bolded text help now?)
Also, the fact that this bug has made its way from v1.0 to