Scheduler - EntityDataSource

  • today
April, 2012
April, 2012
SMTWTFS
       
1234567
891011121314
15161718192021
22232425262728
2930     
Monday, April 16, 2012
  • Day
  • Week
  • Month
  • Timeline
all day
8AM
 
9AM
 
10AM
 
11AM
 
12PM
 
1PM
 
2PM
 
3PM
 
4PM
 
5PM
 
Lunch
Pick up the kids from school.
Show 24 hours...
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

This example shows how to codelessly bind RadScheduler to EntityDataSource.

<telerik:RadScheduler runat="server" ID="RadScheduler1" Width="748px" SelectedDate="2007-03-30"
	DayStartTime="08:00:00" DayEndTime="18:00:00" DataKeyField="ID" DataSubjectField="Subject"
	DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule"
	DataRecurrenceParentKeyField="RecurrenceParentID" DataSourceID="EntityDataSource1">
</telerik:RadScheduler>
<asp:EntityDataSource runat="server" ID="EntityDataSource1" ConnectionString="name=TelerikReadWriteEntities"
	DefaultContainerName="TelerikReadWriteEntities" EntitySetName="Appointments" EnableDelete="true"
	EnableInsert="true" EnableUpdate="true">
</asp:EntityDataSource>

You may also see how to utilize Telerik OpenAccess ORM as a data access layer for our AJAX controls by visiting the OpenAccess ORM live demos here.

  • DefaultCS.aspx
<%@ Page Language="C#"  %>

<%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<%@ 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 runat="server">
    <title>Telerik ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1">
    </telerik:RadAjaxLoadingPanel>
    <div class="demo-container no-bg">
        <telerik:RadScheduler RenderMode="Lightweight" runat="server" ID="RadScheduler1" SelectedDate="2012-04-16"
            DayStartTime="08:00:00" DayEndTime="18:00:00" DataKeyField="ID" DataSubjectField="Subject"
            DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule"
            DataRecurrenceParentKeyField="RecurrenceParentID" DataSourceID="EntityDataSource1"
            OverflowBehavior="Auto">
            <ResourceTypes>
                <telerik:ResourceType KeyField="ID" Name="Room" TextField="RoomName" ForeignKeyField="RoomID"
                    DataSourceID="EntityDataSource2"></telerik:ResourceType>
                <telerik:ResourceType KeyField="ID" Name="User" TextField="UserName" ForeignKeyField="UserID"
                    DataSourceID="EntityDataSource3"></telerik:ResourceType>
            </ResourceTypes>
        </telerik:RadScheduler>
        <asp:EntityDataSource runat="server" ID="EntityDataSource1" ConnectionString="name=TelerikReadWriteEntities"
            DefaultContainerName="TelerikReadWriteEntities" EntitySetName="Appointments" EnableDelete="true"
            EnableInsert="true" EnableUpdate="true">
        </asp:EntityDataSource>
        <asp:EntityDataSource runat="server" ID="EntityDataSource2" ConnectionString="name=TelerikReadWriteEntities"
            DefaultContainerName="TelerikReadWriteEntities" EntitySetName="Rooms">
        </asp:EntityDataSource>
        <asp:EntityDataSource runat="server" ID="EntityDataSource3" ConnectionString="name=TelerikReadWriteEntities"
            DefaultContainerName="TelerikReadWriteEntities" EntitySetName="Users">
        </asp:EntityDataSource>
    </div>
    </form>
</body>
</html>

Find Assistance

Help Us Improve

Was this example helpful?