New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

OData Binding

  • today
April 2012
April 2012
SMTWTFS
       
1234567
891011121314
15161718192021
22232425262728
2930     
4/15/2012 - 4/21/2012
  • Day
  • Week
  • Month
  • Timeline
all day
8AM
9AM
10AM
11AM
12PM
1PM
2PM
3PM
4PM
5PM
Show 24 hours...

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.

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
<%@ Page Title="" Language="VB"  AutoEventWireup="false" CodeFile="DefaultVB.aspx.vb" Inherits="Scheduler_Examples_OData_DefaultVB" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadODataDataSource ID="ODataDataSource1" runat="server">
        <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>
    <div class="demo-container no-bg">
        <telerik:RadScheduler RenderMode="Lightweight" 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>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance