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

[Solved] Setting a RadCalendar's Selected Dates

0 Answers 57 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Reid
Top achievements
Rank 2
Reid asked on 26 May 2011, 07:06 PM

I have this code to set a selected date that does not seem to be working.

<%= Html.Telerik().Calendar()
            .Name("Calendar")
            .Theme("telerik")           
            .Value((DateTime)ViewData["selectedDate"])
            .MinDate((DateTime)ViewData["minDate"])
            .MaxDate((DateTime)ViewData["maxDate"])
              
    %>

I see no selected dates.  My objective is to set a collection of selected dates on the calendar in advance.  The theme is for the user to see dates that events are scheduled. 

In the code above I am aware that it is setting one date, I am setting that ViewData[] value in the controller. Yet when the View loads the calendar does not appear to display a skin and no dates appear selected.  The calendar also contains more days than the current month, yet I see no way to change that.  This could be because of the error, all the JS does not execute.

Please see the attached file.  It is as though the calendar is not seeing the stylesheet .css. 

I am getting a JavaScript error when the template loads..

Microsoft JScript runtime error: '$.telerik.datetime' is null or not an object

in the JS debugger it is happening on this line:

  • jQuery('#Calendar').tCalendar({selectedDate:new $.telerik.datetime(2011,04,27), minDate:new $.telerik.datetime(1900,00,01), maxDate:new $.telerik.datetime(2099,11,31)});});

Thanks,
Reid

Tags
Calendar
Asked by
Reid
Top achievements
Rank 2
Share this question
or