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

[Solved] Help with RadScheduler, multiple resources

1 Answer 184 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
antonio
Top achievements
Rank 1
antonio asked on 20 May 2008, 05:00 PM
Hello,
I am evaluating the RadScheduler and have run into a problem.  I created a control, dragged the scheduler and followed the instructions in the tutorial about creating the class myDBSchedulerProvider.  In addittion, I added the following in the Page_Load event:
        if (!IsPostBack)
        {
            MyDbSchedulerProvider schedulerProvider = new MyDbSchedulerProvider();
            RadScheduler1.Provider = schedulerProvider;
            RadScheduler1.SelectedView = SchedulerViewType.MonthView;
        }

The scheduler displays but it doesn't fetch any data.  If I click on the navigation arrows, or change the selected view, it gives an error saying that DataKeyField, DataSubjectField,etc are missing for databinding.  Do I have to map those to a DB field? or do I need to create a custom class for the appointment and map to its properties? 

If anybody could provide some sample code I'd appreciate.

Thanks.

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 21 May 2008, 03:03 PM
Hi,

You should instantiate your provider on every page load, regardless if it is a post-back or not. It cannot be persisted between the requests. For example:

if (!IsPostBack) 
    RadScheduler1.SelectedView = SchedulerViewType.MonthView; 
 
MyDbSchedulerProvider schedulerProvider = new MyDbSchedulerProvider(); 
RadScheduler1.Provider = schedulerProvider; 
 

Alternatively, you can configure your provider through the web.config file, as described in this help article. This way a single provider instance will be used across the application domain.

Kind regards,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
antonio
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or