Hello,
I have followed the example: Creating and adding an appointment template dynamically and accessing the appointment object in the template class.
I have binded a RadScheduler control to an SqlDataSource and am able to display a RoomID in the appointment template but only if RoomID is from the same table as the SqlDataSource (Appointments in this case). However, I would like to display the RoomName value from another table: Rooms. Therefore I have modified the SelectCommand for the data source to perform an inner join on the two tables to obtain the RoomName from Rooms. See below:
I am trying to display the value of 'rName' in the same way that the example in the above link displays 'Start', 'End' and 'Subject'. Ie:
When I run the web application, I'm presented with the following error:
Server Error in '/' Application.
Exception Details: System.Web.HttpException: DataBinding: 'Telerik.Web.UI.Appointment' does not contain a property with the name 'rName'.
Source Error:
Source File: ...\Projects\WebApplication5\WebApplication5\Default.aspx Line: 32
Please can you advise what I am doing wrong here?
Regards,
Anthony.
I have followed the example: Creating and adding an appointment template dynamically and accessing the appointment object in the template class.
I have binded a RadScheduler control to an SqlDataSource and am able to display a RoomID in the appointment template but only if RoomID is from the same table as the SqlDataSource (Appointments in this case). However, I would like to display the RoomName value from another table: Rooms. Therefore I have modified the SelectCommand for the data source to perform an inner join on the two tables to obtain the RoomName from Rooms. See below:
SelectCommand="SELECT Appointments.ID, Appointments.Subject, Appointments.Description, Appointments.Start, Appointments.RoomID, Appointments.UserID, Appointments.RecurrenceRule, Appointments.[End], Appointments.Annotations, Appointments.Reminder, Appointments.RecurrenceParentID, Rooms.ID AS Expr1, Rooms.RoomName as rName FROM Appointments INNER JOIN Rooms ON Appointments.RoomID = Rooms.ID"
I am trying to display the value of 'rName' in the same way that the example in the above link displays 'Start', 'End' and 'Subject'. Ie:
<
asp:Literal
ID
=
"AppointmentLocation"
runat
=
"server"
Text='<%# Eval("rName") %>'></
asp:Literal
>
When I run the web application, I'm presented with the following error:
Server Error in '/' Application.
DataBinding: 'Telerik.Web.UI.Appointment' does not contain a property with the name 'rName'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Web.HttpException: DataBinding: 'Telerik.Web.UI.Appointment' does not contain a property with the name 'rName'.
Source Error:
Line 30: |
Source File: ...\Projects\WebApplication5\WebApplication5\Default.aspx Line: 32
Please can you advise what I am doing wrong here?
Regards,
Anthony.