Telerik RadScheduler Bind to SQL Server With Different Resource

Code Overview:

<telerik:RadSplitBar runat="server" ID="RadSplitBar2" CollapseMode="Forward" />
            <telerik:RadPane runat="Server" ID="rightPane" Scrolling="None" Width="615px">
                <telerik:RadScheduler runat="server" ID="RadScheduler1" Skin="Windows7" Height="551px"
                    ShowFooter="False" SelectedDate="2009-02-02" TimeZoneOffset="00:00:00"
                    DayEndTime="21:00:00" FirstDayOfWeek="Monday" LastDayOfWeek="Friday"
                    AppointmentStyleMode="Default" OnNavigationComplete="RadScheduler1_NavigationComplete"
                    OnAppointmentCreated="RadScheduler1_AppointmentCreated" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
                    OnAppointmentDelete="RadScheduler1_AppointmentDelete" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"
                    OnAppointmentInsert="RadScheduler1_AppointmentInsert" 
                    DataEndField="End" DataKeyField="Id" 
                    DataSourceID="EntityDataSource1" DataStartField="Start" 
                    DataSubjectField="Subject">
                    <AdvancedForm Modal="true" />
                    <TimelineView UserSelectable="false" />
                    <ResourceTypes>
                        <telerik:ResourceType KeyField="Id" Name="Room" TextField="Description" 
                        ForeignKeyField="TestResourceId"
                            DataSourceID="EntityDataSource2" />
                    </ResourceTypes>
                    <ResourceStyles>
                         <telerik:ResourceStyleMapping Type="Room" Text="resource A" BackColor="Blue" />
                         <telerik:ResourceStyleMapping Type="Room" Text="resource B" BackColor="Orange" />
                         <telerik:ResourceStyleMapping Type="Room" Text="resource A" ApplyCssClass="rsCategoryGreen" />
                    </ResourceStyles>
                    <AppointmentTemplate>
                        <div class="rsAptSubject">
                            <%# Eval("Subject") %>
                        </div>
                        <%# Eval("Description") %>
                    </AppointmentTemplate>
                    <TimeSlotContextMenuSettings EnableDefault="true" />
                    <AppointmentContextMenuSettings EnableDefault="true" />
                </telerik:RadScheduler>
                
                <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
                    ConnectionString="name=IAppointmentEntities" 
                    DefaultContainerName="IAppointmentEntities" EnableFlattening="False" 
                    EntitySetName="Appointments">
                </asp:EntityDataSource>
                <asp:EntityDataSource ID="EntityDataSource2" runat="server" 
                    ConnectionString="name=IAppointmentEntities" 
                    DefaultContainerName="IAppointmentEntities" EnableFlattening="False" 
                    EntitySetName="TestResources">
                </asp:EntityDataSource>
                
            </telerik:RadPane>
        </telerik:RadSplitter>

Two Tables Structure


Sample Data

Appointments

ID Subject Description StartEnd RecurrenceRuleRecurrenceParentID ReminderAnnotations TestResourceId
1 .NET User Group MeetingNULL 2011-11-14 12:00:00.0002011-11-15 12:00:00.000 NULLNULL NULLNULL 1
2 Scrum TrainingNULL 2011-11-13 12:00:00.0002011-11-15 12:00:00.000 NULLNULL NULLNULL 1
3 Integration Partners Conference CallNULL 2011-11-12 12:00:00.0002011-11-15 12:00:00.000 NULLNULL NULLNULL 2
4 DevConnect conferenceNULL 2011-11-11 12:00:00.0002011-11-15 12:00:00.000 NULLNULL NULLNULL 2
5 DevMedia conferenceNULL 2011-11-10 12:00:00.0002011-11-15 12:00:00.000 NULLNULL NULLNULL 1

TestResources

Id Description
1 resource A
2 resource B
3 resource C
4 resource D
5 resource E


Note (Enhancement): here is sample data for RecurrenceRule

DTSTART:20070330T063000Z  DTEND:20070330T073000Z  RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20070406T210000Z;BYDAY=MO,TU,WE,TH,FR; 

DTSTART:20080218T000000Z 
DTEND:20080219T000000Z 
RRULE:FREQ=MONTHLY;INTERVAL=12;BYDAY=-2MO;COUNT=3;

 

This rule says: "The event starts at midnight on 18th of February 2008, lasts one day and repeats each year, for 3 years, on the second to last Monday of February". Now say this three times fast.

RecurrencePattern - This is the pattern that the appointment recurs by, whether it's on an hourly, daily, etc. basis (frequency), the day(s) of the week to recur on (DayOfWeekMask), the number of times to separate recurrence appointments by (every 2 weeks, every 5 days, etc.,which is the Interval), and several more factors.

RadScheduler currently uses either the DaysOfWeekMask or the Interval property of the DailyRecurrenceRule,e.g: .DaysOfWeekMask = Telerik.Web.UI.RecurrenceDay.WeekDays

Good Resource: http://dotnetslackers.com/articles/aspnet/Using-Teleriks-Scheduler-Component.aspx

http://dotnetslackers.com/articles/aspnet/Understanding-Teleriks-Scheduler-Recurrence.aspx

http://blogs.telerik.com/aspnet-ajax/posts/08-08-04/working-with-radscheduler-recurring-appointments-on-sql-server.aspx

Resource Style:

http://www.telerik.com/help/aspnet-ajax/scheduler-appearance-setting-appointment-style.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值