Hi,
I have a webdatepicker contol (with the DropDownCalendarId not set) with the culture set as en-AU in a TemplateDataField in a webhierarchicalgrid. When the site is published to my local iis, the dropdown calendar displays Today: 28/10/2010
However, when the site is published to a webserver, the dropdown calendar displays Today: 10/28/2010. The regional settings and language options on the server are set to Australia.
I have also tried to manually add a WebMonthCalendar in the TemplateDataField and set this as the DropDownCalendarId. However, when I do this I get the following error :
Message : Multiple controls with the same ID 'it3_0' were found. FindControl requires that controls have unique IDs. Source : System.Web Help link : ErrorCode : -2147467259 Data : System.Collections.ListDictionaryInternal TargetSite : Void FillNamedControlsTable(System.Web.UI.Control, System.Web.UI.ControlCollection) Stack Trace : at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) at System.Web.UI.Control.EnsureNamedControlsTable() at System.Web.UI.Control.FindControl(String id, Int32 pathOffset) at System.Web.UI.Control.FindControl(String id, Int32 pathOffset) at System.Web.UI.Control.FindControl(String id, Int32 pathOffset) at System.Web.UI.Control.FindControl(String id, Int32 pathOffset) at System.Web.UI.Control.FindControl(String id, Int32 pathOffset) at System.Web.UI.Control.FindControl(String id, Int32 pathOffset) at System.Web.UI.Control.FindControl(String id, Int32 pathOffset) at System.Web.UI.Page.FindControl(String id) at System.Web.UI.Page.RegisterRequiresClearChildControlState(Control control) at System.Web.UI.Control.ClearChildControlState() at System.Web.UI.WebControls.SiteMapPath.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I would appreciate your assistance in this regard.
Thanks
Hello csggroup,
I built a simple WebDatePicker application with Culture set to "en-AU" and deployed this in IIS. On testing the same I was unable to replicate the issue. Attached is the sample and snapshot. Please feel free to update the sample attached or share a sample of your own replicating the issue with screenshot.
Thank you,
Swetha
The shared calendar used by WebDatePicker by default uses System.Threading.Thread.CurrentThread.CurrentCulture for its culture. If for some reason that culture does not match with actual current culture on server, then application may find shared calendar and modify its culture to any desired value.Note: if the only datepicker used by an application is located in a template, which instantiated at PreRender, then shared caledar maybe not available at OnLoad or similar event. In this case application may force early creation of shared calendar, regardless if it ever will be used by any possible WebDatePicker. The static method EnsureSharedCalendar was not available in first release and it was added around half year ago. To find calendar the FindSharedCalendar method of WebDatePicker can be used. If application can not find reference to WebDatePicker, then explicit (internal) ID of shared calendar can be used.
Below is example to find shared calendar:
protected void Page_Load(object sender, EventArgs e){ Infragistics.Web.UI.EditorControls.WebDatePicker.EnsureSharedCalendar(this); Infragistics.Web.UI.EditorControls.WebMonthCalendar calendar = null; // find reference to date picker within your template // line below assumes WebDatePicker1 located in form Infragistics.Web.UI.EditorControls.WebDatePicker datePicker = this.WebDatePicker1; if(datePicker != null) calendar = this.WebDatePicker1.FindSharedCalendar(); if(calendar == null) calendar = this.Form.FindControl("_ig_def_dp_cal") as Infragistics.Web.UI.EditorControls.WebMonthCalendar; if(calendar != null) { calendar.Culture = System.Threading.Thread.CurrentThread.CurrentCulture; }}