Welcome Guest Search | Active Topics | Sign In | Register

Using CSS with the datepicker (or other) controls Options
breese
Posted: Monday, September 24, 2007 4:18:49 AM
Rank: Newbie
Groups: Member

Joined: 9/24/2007
Posts: 9
We are looking to replace our current calendar datepicker controls with the EssentialObjects datepicker control. We have about 60 or 70 controls on about 50 pages which need to be replaced with the EO datepicker, so it's important that we can streamline the process. Not only would this make it easier to add the controls, but it would save bandwidth by caching the common file between every control needed. The way we are doing it now adds all of hte css information directly in the html for the control. I have added about 3 datepicker controls, to our application. Each time I add one I have to manually set the properties and tell the thing that I want it to use the 'Windows Vista' skin and any other specific things that I want the control to look like.

Throughout the site, if we are using a datepicker control, we want them to all look and act the same. I would like to use a centralized .css file which we already have in place to control these things. I can't find any documentation regarding this on the website - can you point me in the right direction or help me with this?

I have seen options to save or load from a skin - what is this? Will CSS do everything we want? I believe all of the graphics and javscript is loaded from the dll, so hopefully I wont' have to fool with placing that in different directories.

Thanks for your help,

Brooks
breese
Posted: Monday, September 24, 2007 6:29:46 AM
Rank: Newbie
Groups: Member

Joined: 9/24/2007
Posts: 9
I have managed to setup an external .css file, but it's still really awkward. Just telling the calendar which styles to use makes the html of the calendar makes the datepicker's html almost as big as it would be if I were to define the style directly on the page.

Is it possible to define my .css file so it automatically sets the different styles for the calendar? Lines like this <MonthStyle CssClass="DatePicker16" /> really take up a lot of space. Also, what is the best practice for setting up a single .css file for all of the EO controls? I have made a file called EO.css, is this a good idea? How do I separate the different css for each control within that file?

Thanks,

Brooks
eo_support
Posted: Monday, September 24, 2007 7:32:25 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Brooks,

Setting up a externa .css file is a good way to do it. The other way you can do it is to use a skin. In order to use a skin, you would first create the DatePicker, save it as a skin, then call LoadCalendarSkin to load it and assign it an ID. Once you do that, you will be able to set the DatePicker's ControlSkinID to the ID of that skin. That way it will inherit appearance value from that the skin control. Watch out two things when using skin:

1. Both DatePicker and Calendar, the skin has to be a DatePicker control;
2. Skin only provides the "default value", that is, those value can be overriden on the control itself, when that happens, the control won't look exactly like the skin;

You separate the different css for each control by the class name. The CSS class name are not fixed ---- for example, you can change "DatePicker16" to whatever you like, just make sure it does exist in your .css file.

Please let us know if you have any more question.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.