Scheduler

Controls

Rate this demo

Thank you for your post!
Submit a support ticket
If you have an active license or trial, you have access to dedicated support from Telerik’s developers. Response time is 24h for active licenses and 72h for trials, Mon-Fri.
Post in the forums
If you don’t have access to support or would like to help other people by sharing your problem, reach out to our active community in the forums.

Scheduler - OData Binding

previous daynext daytoday

Select date
Calendar
Title and navigation
Title and navigation
<<<April 2012><<
April 2012
SMTWTFS
       
1234567
891011121314
15161718192021
22232425262728
2930     

4/15/2012 - 4/21/2012

all day
8AM
 
9AM
 
10AM
 
11AM
 
12PM
 
1PM
 
2PM
 
3PM
 
4PM
 
5PM
 
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       

RadScheduler supports seamless integration with the RadODataDataSource controls which makes binding to OData feed an easy task.

In contrast to the standard WebService binding, the OData binding does not require serialized AppointmentData objects. Instead, the developer is free to expose whatever objects they want as a JSON feed, as long as the data is meaningful to the Scheduler.

Binding using the RadODataDataSource control is very similar the standard binding mechanism except for the fact that the RadScheduler is in Read-Only mode. The following properties could be set in order to map the exposed feed to the binding fields:

  • DataStartField
  • DataEndField
  • DataKeyField
  • DataDescriptionField
  • DataSubjectField
  • DataModelID

DataModelID should resemble a model defined in the RadODataDataSource control.

The InitialContainerName property is now depricated and DataModelID should be used instead.

C# VB
Show code in new window Demo isolation steps
<%@ Page Language="C#"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
    <title>oData Binding in ASP.NET Scheduler | RadScheduler demo</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadODataDataSource ID="ODataDataSource1" runat="server">
        <Transport>
            <Read Url="SchedulerODataWcfService.svc"></Read>
        </Transport>
        <Schema>
            <telerik:DataModel ModelID="Appointments" Set="Appointments">
                <telerik:DataModelField FieldName="ID"></telerik:DataModelField>
                <telerik:DataModelField FieldName="Subject"></telerik:DataModelField>
                <telerik:DataModelField FieldName="Start"></telerik:DataModelField>
                <telerik:DataModelField FieldName="End"></telerik:DataModelField>
            </telerik:DataModel>
        </Schema>
    </telerik:RadODataDataSource>
    <telerik:RadScheduler ID="RadScheduler1" runat="server" SelectedView="WeekView" SelectedDate="4/15/2012"
        ODataDataSourceID="ODataDataSource1" DataKeyField="ID" DataModelID="Appointments"
        DataStartField="Start" DataEndField="End" DataSubjectField="Subject" ReadOnly="True">
    </telerik:RadScheduler>
    </form>
</body>
</html>