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

setting datetimepicker value client side troubles

4 Answers 111 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Rabih
Top achievements
Rank 1
Rabih asked on 22 Dec 2011, 03:52 PM
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.

4 Answers, 1 is accepted

Sort by
0
Rabih
Top achievements
Rank 1
answered on 23 Dec 2011, 07:55 AM
anybody there ?!!!!
0
Richard
Top achievements
Rank 1
answered on 23 Dec 2011, 05:13 PM
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!
0
Princy
Top achievements
Rank 2
answered on 26 Dec 2011, 07:05 AM
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.
0
Rabih
Top achievements
Rank 1
answered on 27 Dec 2011, 02:37 PM
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.
Tags
Calendar
Asked by
Rabih
Top achievements
Rank 1
Answers by
Rabih
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or