This is a migrated thread and some comments may be shown as answers.

RadDatePicker culter is not reflected from page_load

3 Answers 88 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Murari
Top achievements
Rank 1
Murari asked on 27 Mar 2012, 12:30 PM

Hi
i am using  raddatepicker in ascx page
<radCln:RadDatePicker ID="dtpDateOfBirthDriverDetail" Culture="(Default)" runat="server" Width="170px" EnableTyping="False">

 

<DateInput Skin="" ReadOnly="True">  

 

</DateInput>  

 

<Calendar runat="server" FastNavigationStep="12">  

 

</Calendar>  

 

<ClientEvents OnDateSelected="Driver_CalculateAge" />  

 

</radCln:RadDatePicker>
and its Culture is updated vai page_load of ascx.cs page  

System.Globalization.CultureInfo c = new System.Globalization.CultureInfo(sCulture); 

c.DateTimeFormat.CalendarWeekRule = System.Globalization.CalendarWeekRule.FirstFourDayWeek; 

c.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Monday;
dtpDateOfBirthDriverDetail.Culture=c;

 

but its functinality is not working as expected for "week no"   or as working in other aspx pages
while it is working fine for aspx pages 

3 Answers, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 30 Mar 2012, 12:44 PM
Hello,

Please try to assign a culture property in the code-behind as it is shown in the example bellow:
protected void Page_Load(object sender, EventArgs e)
   {
       dtpDateOfBirthDriverDetail.Culture = new System.Globalization.CultureInfo("fr-FR", true);
       dtpDateOfBirthDriverDetail.Calendar.FirstDayOfWeek = FirstDayOfWeek.Monday;
   }

Additional information on this matter can be found here.

I hope this helps.

All the best,
Milena
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Murari
Top achievements
Rank 1
answered on 02 Apr 2012, 08:50 AM
Hi

Thanks for the response

This solution does not worked for me

actually i am using user control ,
and on each button click of usercontrol  ,if  RadDatepicker CulterInfo is  updated than it works  fine
But if i write the code for culter setting in page_load . then it does not work

is there any way to set it from one place.



0
Milena
Telerik team
answered on 04 Apr 2012, 02:04 PM
Hello,

I am not sure that completely understand your scenario, but attached you can find a sample project, where it is demonstrated how could be set a culture to the RadDatePicker in Page_Load method(from user control and parent page). Additionally, you can see how the culture can be applied when a button is clicked. Please, review the project and let me know if I am missing something in replicating the issue.

All the best,
Milena
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Calendar
Asked by
Murari
Top achievements
Rank 1
Answers by
Milena
Telerik team
Murari
Top achievements
Rank 1
Share this question
or