This is a migrated thread and some comments may be shown as answers.

How to create custom Appointment Template in RadScheduler

1 Answer 439 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
mohsen
Top achievements
Rank 1
mohsen asked on 21 Jan 2013, 08:58 AM
hi all, i Beginner in RadScheduler control, i want create custom Appointment Template, i write this code
<telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Office2010Blue" DisplayRecurrenceActionDialogOnMove="True" ShowNavigationPane="True"
            OnClientTimeSlotContextMenuItemClicked="ClientTimeSlotContextMenuItemClicked" OnClientAppointmentContextMenuItemClicked="ClientAppointmentContextMenuItemClicked">
            <TimelineView UserSelectable="False" />
            <DayView UserSelectable="False" />
            <AppointmentContextMenus>
                <%--The appointment context menu interaction is handled on the client in this example--%>
                <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu">
                    <Items>
                        <telerik:RadMenuItem Text="Detils" Value="detail">
                        </telerik:RadMenuItem>
                       
                       
                        <telerik:RadMenuItem Text="MoreStatus" Value="moreStatus">
                        </telerik:RadMenuItem>
                    </Items>
                </telerik:RadSchedulerContextMenu>
            </AppointmentContextMenus>
            <TimeSlotContextMenus>
                <telerik:RadSchedulerContextMenu ID="SchedulerTimeSlotContextMenu" runat="server">
                    <Items>
                        <telerik:RadMenuItem Text="New" Value="createNew" />
                    </Items>
                </telerik:RadSchedulerContextMenu>
            </TimeSlotContextMenus>
            
            <AppointmentTemplate>
                <div class="rsAptSubject">
                    
                </div>
                <hr />
                <div style="font-style: italic; background-color: Lime"><%# Eval("FromTime")%></div>
            </AppointmentTemplate>
        </telerik:RadScheduler>

and c# code:
RadScheduler1.DataSource = _meetingService.AllMeetings().ToList()
       RadScheduler1.DataStartField = "FromTime"
       RadScheduler1.DataSubjectField = "Council.CouncilName"
       RadScheduler1.DataEndField = "ToTime"
       RadScheduler1.DataKeyField = "MeetingId"
       RadScheduler1.DataDescriptionField = "FromTime"
       ' RadScheduler1.SelectedDate = DateTime.Now
       RadScheduler1.DataBind()
but when run this page i get this error:

DataBinding: 'Telerik.Web.UI.Appointment' does not contain a property with the name 'FromTime'.


please help me for solve this problem. thanks Expert.

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 24 Jan 2013, 07:06 AM
Hello Mohsen,

 
The code looks correct -just make sure that the code behind is in Page_Init (or in the Page_Load) method or your DataSouce is correctly build.

I am attaching a sample web page where similar issue is working properly.

Hope this will be helpful.

Greetings,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
mohsen
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or