Data Binding

The Scheduler provides a set of options for binding it to data.

ninja-iconNew to Telerik UI for ASP.NET Core?Telerik UI for ASP.NET Core is a professional grade UI library with 110+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.Start Free Trial

The supported data-binding approaches are:

Model Requirements

The model that binds to the Scheduler extends the ISchedulerEvent interface, which has the following properties:

C#
 public interface ISchedulerEvent
 {
     //Content Lines
     string Title
     {
         get;
         set;
     }
     string Description
     {
         get;
         set;
     }

     //Duration
     bool IsAllDay
     {
         get;
         set;
     }

     DateTime Start
     {
         get;
         set;
     }

     DateTime End
     {
         get;
         set;
     }

     string StartTimezone
     {
         get;
         set;
     }

     string EndTimezone
     {
         get;
         set;
     }

     string RecurrenceRule
     {
         get;
         set;
     }

     string RecurrenceException
     {
         get;
         set;
     }
 }

The next table lists the required model properties of the Scheduler and their default values.

PropertyMandatoryDefault ValueDescription
IdYesnoneThe unique model identifier of the Scheduler event. Required for creating, editing, and deleting records.
TitleYesnoneThe title or subject of the event.
StartYesnoneThe starting date and time of the event.
EndYesnoneThe ending date and time of the event. Must be later than Start.
RecurrenceRuleNonullThe rule that defines the recurrence pattern. If not provided or set to null, the event is not treated as a recurring event.
RecurrenceIDNonullLinks an exception or occurrence to its recurring master event.
RecurrenceExceptionNonullA comma-separated list of dates when the recurring event will be skipped.
IsAllDayNofalseIndicates whether the event spans the entire day.
DescriptionNoempty string ("")Optional text description of the event.

When using HtmlHelper Scheduler, the model properties are automatically mapped to camelCase fields on the client.

When using TagHelper Scheduler, you need to set the "name" and "from" attributes manually in the schema configuration of the DataSource.

The following example shows how to set the properties of the DataSource for the TagHelper:

Razor
    <scheduler-datasource type="@DataSourceTagHelperType.Ajax">
        <transport>
            <read url="@Url.Action("Overview_Read", "Scheduler")" />
            <create url="@Url.Action("Overview_Create", "Scheduler")" />
            <destroy url="@Url.Action("Overview_Destroy", "Scheduler")" />
            <update url="@Url.Action("Overview_Update", "Scheduler")" />
        </transport>
        <schema data="Data" total="Total" errors="Errors">
            <scheduler-model id="ID">
                <fields>
                    <field name="ID" type="number"></field>
                    <field name="title" from="Title" type="string" default-value="@defaultTitle"></field>
                    <field name="start" from="Start" type="date"></field>
                    <field name="end" from="End" type="date"></field>
                    <field name="description" from="Description" type="string"></field>
                    <field name="recurrenceId" from="RecurrenceID" type="number" default-value=null></field>
                    <field name="recurrenceRule" from="RecurrenceRule" type="string" ></field>
                    <field name="recurrenceException" from="RecurrenceException" type="string"></field>
                    <field name="Attendee" type="number" default-value="1"></field>
                    <field name="startTimezone" from="StartTimezone" type="string"></field>
                    <field name="endTimezone" from="EndTimezone" type="string"></field>
                    <field name="isAllDay" from="IsAllDay" type="boolean"></field>
                </fields>
            </scheduler-model>
        </schema>
    </scheduler-datasource>

See Also

In this article
Model RequirementsSee Also
Not finding the help you need?
Contact Support