setting datetimepicker value client side troubles

5 posts, 0 answers
  1. Rabih
    Rabih avatar
    16 posts
    Member since:
    Oct 2011

    Posted 22 Dec 2011 Link to this post

    Hello,
    i am trying to set the selected date of a datetimepicker client side, the datetime i am trying to set is of the following format:
    15/12/2011 12:00:00 AM
     this is my line of code : rdtpLastDateTime.set_selectedDate(result[0].Maximum); //  result[0].Maximum = 15/12/2011 12:00:00 AM
    but the debuger breaks and throws exception: Object doesn't support this property or method
    Please help on this topic
    Thanks.
  2. Rabih
    Rabih avatar
    16 posts
    Member since:
    Oct 2011

    Posted 23 Dec 2011 Link to this post

    anybody there ?!!!!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. jumpstart
    jumpstart avatar
    479 posts
    Member since:
    Nov 2011

    Posted 23 Dec 2011 Link to this post

    Rabih:

    Have you properly set the culture to allow for your date style? See RadControls for ASP.NET AJAX Documentation/Specifying a Culture for insights.

    Also, have you tried to set the SelectedValue instead of SelectedDate property? SelectedDate returns only the selected value from the date part of the RadDateTimePicker control. SelectedValue returns the selected date and time value.

    Hope this helps.

    Cheers!
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Dec 2011 Link to this post

    Hello,

    You can try the following.

    JS:
    function OnClientClick()
      {
         var RadDateTimePicker3 = $find("<%=RadDateTimePicker3.ClientID %>");
         var t = "15/12/2011 12:00:00 AM";
         RadDateTimePicker3.get_dateInput().set_value(t);
      }

    Thanks,
    Princy.
  6. Rabih
    Rabih avatar
    16 posts
    Member since:
    Oct 2011

    Posted 27 Dec 2011 Link to this post

    Hello all,
    i've tried this syntax :
    var currentDatePicker = rdtpLastDateTime;
    rdtpLastDateTime.set_selectedDate(currentDatePicker.get_dateInput().parseDate(result[0].Maximum));
    and it worked for me
    thanks for all of you.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017