The Q3 release RadControls will come packed with shiny features and a couple of new controls, but that’s not all! We’ve fiddled with the complex machinery under the hood and made it better too.
Let me introduce you the new and improved provider interface (ABC, actually) for RadScheduler:
(code abbreviated for clarity)
The key difference between the old and the new version is that you now get a reference to ISchedulerInfo instead of RadScheduler. This allows you to easily send additional information to the provider without resorting to side-channels such as the Session.
We’ve also rolled the old GetResourceTypes and GetResourcesByType methods into a single method for convenience.
Note: All changes are backwards-compatible and any existing implementations of SchedulerProvider will continue to work without modification. For new implementations we recommend overriding the new methods that take ISchedulerInfo.
Let’s see how to take advantage of these improvements in practice:
Sending additional information to the provider (server-side binding)
1. Start by inheriting the default ISchedulerInfo implementation and add your custom properties.
Copying the base properties is tedious and we’ll add a copy constructor in place for the official release.
2. Send the customized MySchedulerInfo to RadScheduler in one of the following events:
For example:
protected void RadScheduler1_AppointmentsPopulating(object sender, AppointmentsPopulatingEventArgs e)
{
e.SchedulerInfo = new MySchedulerInfo(e.SchedulerInfo, User.Identity.Name);
}
3. Cast the schedulerInfo to MySchedulerInfo in the corresponding provider method
public override IEnumerable<Appointment> GetAppointments(ISchedulerInfo schedulerInfo)Sending additional information to the provider (web service binding)
The code is the same as when using server-side binding, but you’re sending the additional information in the client-side events instead:
<script type="text/javascript">
That’s it! Go play with the Q3 Beta today and let us know if you like what you see!
Iana Tsolova is Product Manager at Telerik’s DevTools division. She joined the company back in the beginning of 2008 as a Support Officer and has since occupied various positions at Telerik, including Senior Support Officer, Team Lead at one of the ASP.NET AJAX teams and Technical Support Director. Iana’s main interests are web development, reading articles related to geography, wild nature and latest renewable energy technologies.