RadDatePicker culter is not reflected from page_load

4 posts, 0 answers
  1. Murari
    Murari avatar
    3 posts
    Member since:
    Mar 2012

    Posted 27 Mar 2012 Link to this post

    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 

  2. Milena
    Admin
    Milena avatar
    224 posts

    Posted 30 Mar 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Murari
    Murari avatar
    3 posts
    Member since:
    Mar 2012

    Posted 02 Apr 2012 Link to this post

    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.



  5. Milena
    Admin
    Milena avatar
    224 posts

    Posted 04 Apr 2012 Link to this post

    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.
Back to Top