Article relates to
RadScheduler for ASP.NET AJAX
February 16, 2009
Last modified by
This article shows how to bind RadScheduler to LinqDataSource and add additional resources to the appointments.
PART I: Preliminaries
In this section we set up the LINQ DataClasses and the SQL data file for RadScheduler.
Note: For this example we will use the Telerik.mdf file from the RadControls examples. It can be found in your local installation of the Telerik.Web.UI suit ->Live Demos\App_Data.
- Copy the Telerik.mdf and Telerik_log.ldf files to the App_Data folder of your project.
- Right-click on the App_Code folder and choose "Add New Item".
- From the dialog window select LINQ to SQL classes:
- When you click the Add button the Object Relational Designer will be displayed.
- From the Server Explorer open the Tables folder and drag the following tables to the
Relational Designer: Appointments, Rooms, Users.
PART II: Configuring the LinqDataSource
- Drag a LinqDataSource to the designer window of the aspx page and follow the steps outlined below:
- Choose "Appointments" for table and select the fields as shown below and press "finish"
- To allow insert, update and delete you need to configure the data source as follows - open the properties window, clear the Select field and set the EnableDelete/Update/Insert fields to true:
- Rename the ID to "AppointmentsDataSource" (Optional)
PART III: Binding RadSchdeduler to the AppointmentsDataSource
- Drag a RadSchdeduler to the designer, click on the smart tag and Choose Data Source and set the fields as shown below:
- You can set properties from the properties window of RadScheduler. For example, Choose Selected Date to be 2007-03-30 and TimeZoneOffset - 03:00:00
At this point you can run the application and you will have a working RadScheduler. However, if you double click an appointment for edit, you will notice that it doesn't have additional resources:
The last part of this article shows how to add resources for the appointments so that you can select additional information:
PART IV: Adding resources
RadScheduler allows you to define custom resources that can be assigned to the appointments. The resources and the data sources for them can be defined easily in design-time.
Lets start by creating a LinqDataSource for the Users and add it to RadScheduler's resource collection.
- Drag a new LinqDataSource design time and configure it with the default values untill you reach the Configure Data Selection part. Then choose the following values:
- Rename the ID of the data source to UsersDataSource (Optional).
- Using the smart tag of RadScheduler, click on the Collection field for Resource Types. A dialog window will be displayed and you can add a new member and set its properties as shown below:
Repeat the same procedure to create a RoomsDataSource and add it as a resource collection to RadScheduler.
You can find attached a working demo project
Enjoy working with the RadScheduler control and the latest MS technologies!
to rate this article.