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; }}
Hi Viktor,
For my webdatechooser control everything working as expected when I change the browser culture except the "Today:10/10/2011".
If I change the browser language as Spanish all the week names and month name are chnaged to spanish but the label "Today:10/10/2011" is still in English.
Any way to change this label also to the current browserculture
Hi Sapineni,
All culture related setting are coming from CultureInfo object, but it does not contain settings for strings like "Today" or "Today date", so application should adjust that setting manually. In case of WebDateChooser, you should use CalendarLayout.FooterFormat property. Its default value is "Today: {0:d}". You may set it to something like "{0:d}".
In case of WebDatePicker, corresponding property of WebMonthCalendar can be used.
what would be the CalendarLayout called in case of :WebDatePicker
<igedit:WebDatePicker ID="date" runat="server" Width="130px" AllowNull="True" Enabled="True" AutoCloseUp="true" ShowDropDown="False" NullDateLabel="Select End Date" NullValueRepresentation="DateTime_MinValue" > <ClientSideEvents ValueChanging="handle_ToDateChanged" InvalidValueEntered="handle_InvalidDateEntered" Blur="handle_ToDateOnBlur" /> <a:CalendarLayout DayNameFormat="FirstLetter" FooterFormat="" ShowFooter="False" ShowNextPrevMonth="False" ShowTitle="False"> <CalendarStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"> </CalendarStyle> <SelectedDayStyle CssClass="SelectedDay" /> <DayHeaderStyle CssClass="DateTimeDayHeader" /> <TitleStyle CssClass="DateTimeTitle" /> <DayStyle CssClass="DateTimeDay" /> </a:CalendarLayout> </igedit:WebDatePicker>