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

Database Provider

  • today
April 2012
April 2012
SMTWTFS
       
1234567
891011121314
15161718192021
22232425262728
2930     
4/15/2012 - 4/21/2012
  • Day
  • Week
  • Month
all day
8AM
9AM
10AM
11AM
12PM
1PM
2PM
3PM
4PM
5PM
History 3
Teacher: Mrs Jane Smith
2 student(s)
Math 1
Teacher: Mr John Doe
1 student(s)
Show 24 hours...
  • Edit
  • Delete
  • New Appointment
  • New Recurring Appointment
  • Go to today
  • Show 24 hours...

RadScheduler follows the Provider Design Pattern to allow for easy integration into existing applications. For more information, please see the Using a Data Provider topic.

To bind RadScheduler to a provider, set its Provider or ProviderName property. Because providers supply information about appointments using the Telerik.Web.UI.Appointment type, you do not need to set the scheduler's DataKeyField, DataSubjectField, DataStartField, DataEndField, DataRecurrenceField and DataRecurrenceParentKeyField properties. Similarly, you do not need to set the ResourceTypes property, as the provider supplies this information. Any values you set on the scheduler at design time are ignored.

Note: This example is read-only due to the nature of the demonstrated provider. The reason is that the provider manipulates the database directly and cannot be isolated for the purposes of the demo.

In order to turn on the write support, you need to download and run the samples locally. Set the RadScheduler's ReadOnly property to "false", then change persistChanges to true in web.config:

    <telerik.web.ui>

        <radScheduler defaultAppointmentProvider="Integrated">

            <appointmentProviders>

                <add name="ReadOnlySchedulerData" type="Telerik.Web.Examples.Scheduler.MyDbSchedulerProvider"

                    connectionStringName="TelerikConnectionString"

                    persistChanges="true" />

            </appointmentProviders>

        </radScheduler>

    </telerik.web.ui>

This example demonstrates how to build a custom database provider for RadScheduler.
The source code for the provider is located in the App_Code directory of the QSF.
Please, refer to the documentation for information about implementing your own providers.
  • DefaultVB.aspx
  • DefaultVB.aspx.vb
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="DefaultVB.aspx.vb" Inherits="Scheduler.Examples.DbSchedulerProvider.DefaultVB" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<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 ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <div class="demo-container no-bg">
        <telerik:RadScheduler RenderMode="Lightweight" runat="server" ID="RadScheduler1" SelectedView="WeekView"
            SelectedDate="2012-04-16" DayStartTime="08:00:00" DayEndTime="18:00:00"
            ProviderName="ReadOnlySchedulerData" ReadOnly="true" OnAppointmentCreated="RadScheduler1_AppointmentCreated">
            <AdvancedForm Modal="true"></AdvancedForm>
            <AppointmentTemplate>
                <asp:Label runat="server" ID="RecurrenceIcon"></asp:Label>
                <%# Eval("Subject") %>
                <br />
                <asp:Label runat="server" ID="Teacher"></asp:Label>
                <br />
                <asp:Label runat="server" ID="Students"></asp:Label>
            </AppointmentTemplate>
            <TimelineView UserSelectable="false"></TimelineView>
            <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
            <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
        </telerik:RadScheduler>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance