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

Programatically changing selected view

1 Answer 65 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Michael Cunningham
Top achievements
Rank 1
Michael Cunningham asked on 19 Mar 2009, 03:10 PM
Hi,

Im trying to recreate the Day - Week - Month Selectors at the top of the rad scheduler. I have added 3 buttons across the top of the page and have the following code hooked up to them

Protected Sub btnDay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDay.Click 
 
RadScheduler1.SelectedView = SchedulerViewType.DayView 
 
End Sub 

When the button is clicked I get the error:

Unable to cast object of type 'Telerik.Web.UI.Scheduler.Rendering.MonthView' to type 'Telerik.Web.UI.Scheduler.Rendering.DayView'

If it makes any difference this is inside of a DNN module.

Thanks!

Michael

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 20 Mar 2009, 01:04 PM
Hi Michael Cunningham,

This error may occur if RadScheduler does not rebind for some reason. How do you populate it with appointments? Do you use a provider or bind ti do some datasource? You can try forcing the binding by calling the Rebind method.

Kind regards,
Albert
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
Michael Cunningham
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or