Monday, November 17, 2008

Sharepoint Date time control rendering issue

Hi all,

We are using SharePoint Date time picker Control in Custom Field as well as in custom web parts.

The problem that we are facing is sometime calendar which is opening looks like there is no CSS applied to that control. But same control works in other list.

This is the rendering issue with Sharepoint date time control.

If we are using this date time control with ajax control then this control is defiantly not work properly.

So while surfing we find the solution on this site

This site says:
To fix the problem, drop the following line of code into %programfiles%\common files\microsoft shared\web server extensions\12\templates\layouts\iframe.aspx
<link rel="stylesheet" type="text/css"href="/_layouts/1033/styles/datepicker.css"/>

Put it right below the <HEAD> tag at the top, and the calendar should render correctly from now on.

We tried it and it work like a charm.
Again thanks to Rich Finn for his wonderful post.


Rajeev Kumar Srivastava said...

I am using DatetimeControl on my Custom page inside sharepoint site. when i select the date its showing date MM/dd/yyyy format in text box how can i change the format to dd/MM/yyyy. Please Help.

Rajiv Kumar Srivastava

James said...

A more fully supported solution that doesn't require changing pages in the layouts folder would involve setting the DatePickerFrameUrl to SPContext.Current.Web.ServerRelativeUrl + "/_layouts/iframe.aspx".

Rajeev - you should always set the LocaleId and Calendar properties to match your regional settings (SPContext.Current.RegionalSettings).

Anonymous said...

Can you please tell how to set the DatePickerFrameUrl to SPContext.Current.Web.ServerRelativeUrl + "/_layouts/iframe.aspx".

Parth Patel said...

Thanks James

Parth Patel said...

if you are using a custom web part only then you can set this as James suggested.

Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to