Sending Additional Information to the Provider
Starting with the Q3 2010 release RadScheduler allows additional information to be sent from the page to each provider method. This is convenient for passing any form of meta-data that is not part of the appointments themselves.
Older versions require the use of a side-channel such as the Session to transfer such meta-data.
Prerquisites
-
In order to be able to receive the information in your provider you must implement the methods that take ISchedulerInfo as parameters. Please see Provider interface changes in Q3 2010
-
Create a custom ISchedulerInfo implementation by inheriting from SchedulerInfo:
public class MySchedulerInfo : SchedulerInfo
{
public string User { get; set; }
public MySchedulerInfo(ISchedulerInfo baseInfo, string user): base(baseInfo)
{
User = user;
}
}
Sending additional information when using server-side data binding
- Send the customized MySchedulerInfo to RadScheduler in one of the following events:
- AppointmentsPopulating
- ResourcesPopulating
- AppointmentInsert
- AppointmentUpdate
- AppointmentDelete
For example:
protected void RadScheduler1_AppointmentsPopulating(object sender, AppointmentsPopulatingEventArgs e)
{
e.SchedulerInfo = new MySchedulerInfo(e.SchedulerInfo, User.Identity.Name);
}
- Cast the schedulerInfo to MySchedulerInfo in the corresponding provider method
public override IEnumerable<Appointment> GetAppointments(ISchedulerInfo schedulerInfo)
{
var myInfo = schedulerInfo as MySchedulerInfo;
// Access myInfo.User
// ...
}
Sending additional information when using web-service data binding
-
Follow the instructions in Sending additional information to the Web Service
-
Cast the schedulerInfo to MySchedulerInfo in the corresponding provider method
public override IEnumerable<Appointment> GetAppointments(ISchedulerInfo schedulerInfo)
{
var myInfo = schedulerInfo as MySchedulerInfo;
// Access myInfo.User
// ...
}