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 asp.net 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.
5 comments:
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.
Regard's
Rajiv Kumar Srivastava
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).
Can you please tell how to set the DatePickerFrameUrl to SPContext.Current.Web.ServerRelativeUrl + "/_layouts/iframe.aspx".
Thanks James
if you are using a custom web part only then you can set this as James suggested.
Post a Comment