Error:
DataBinding: 'Telerik.Web.UI.Appointment' does not contain a property with the name 'Name'.
Reference:
DataSubjectField="Name"
As you see, my subject field is Name, but when I double click to do an inline edit it pops up an error dialogue with the above text.
I have custom attributes on the page also. If I add "Name" to the custom attributes list, then I dont get an error...but then it also just saves an empty string to the DB.
ideas?
thanks.
11 Answers, 1 is accepted
We will be happy to help you but we will need some additional information on this case. For example, how do you data-bind RadScheduler? What is the datasource which you use? Ideally, you can open a support ticket and send us a small demo project.
All the best,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thanks for your inquiry. Yes, there was a solution to this case:
"Please, be advised that when binding template controls you need to bind them to names of appointment's properties, not to column names. For example this line of code:
<asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' style="margin-bottom:5px;"></asp:TextBox> |
should be
<asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Subject") %>' style="margin-bottom:5px;"></asp:TextBox> |
"
Let us know if this is applicable to your project as well or if you need further assistance.
All the best,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
<%
@ Control Language="vb" AutoEventWireup="true" CodeBehind="Calendar.ascx.vb" Inherits="BCL0100.Calendar" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Vista" AllowDelete="False" AllowEdit="True" AllowInsert="False" FirstDayOfWeek="Sunday"LastDayOfWeek="Saturday" OverflowBehavior="Expand" SelectedView="DayView" DataEndField="InterviewTimeEnd" DataKeyField="AppointmentID" DataRecurrenceField="InterviewRecurrence" DataRecurrenceParentKeyField="InterviewRecurrenceKey" DataSourceID="bclwebsite" DataStartField="InterviewTime" DataSubjectField="InterviewSubject" OnDataBound="RadScheduler1_DataBound" CustomAttributeNames="InterviewNotes, InterviewerName">
<
ResourceTypes>
<telerik:ResourceType Name="InterviewNotes" TextField="InterviewNotes" ForeignKeyField="AppointmentID" KeyField="AppointmentID" DataSourceID="DetailsDataSource" />
<telerik:ResourceType Name="InterviewerName" TextField="InterviewerName" ForeignKeyField="InterviewerID" KeyField="SurveyCompletorID" DataSourceID="InterviewerDetailsDataSource" />
</
ResourceTypes>
<
AdvancedEditTemplate>
<
img src="..\..\Images\Misc\CalBG.gif" width="100%" height="28" border="0" />
<
div class="appointments">
<fieldset>
<%
--<legend>Appointment Details</legend>--%>
<asp:Image ID="CalendarIcon" runat="server" ImageAlign="absMiddle" ImageUrl="..\..\Images\Misc\CalendarIcon.gif" /> <span class="larger-font"><asp:Literal ID="Subject" runat="server" Text='<%# Bind("Subject") %>' /> Appointment</span>
<div style="position: relative">
Date & Time:
<asp:Literal ID="StartDate" runat="server" Text='<%# Bind("Start") %>' /><br />
Interviewer:
<asp:Literal ID="InterviewerName" runat="server" Text='<%# Bind("?????") %>' /><br />
<br />
<asp:Literal ID="InterviewNotes" runat="server" Text='<%# Eval("InterviewNotes") %>' /><br />
</div>
<br />
<asp:LinkButton ID="CancelButton" runat="server" Text="Return to Calendar" CommandName="Cancel" />
</fieldset>
</
div>
</
AdvancedEditTemplate>
</
telerik:RadScheduler>
<
asp:SqlDataSource ID="bclwebsite" runat="server" ConnectionString="<%$ ConnectionStrings:bclWebsiteConnectionString %>" SelectCommand="SELECT [AppointmentID], [InterviewerID], [CompanyID], [InterviewTime], [InterviewDate], [InterviewSubject], [IntervieweeID], [InterviewTimeEnd], [InterviewNotes], [InterviewComplete], [CompleteNotes], [DateCanceled], [CancelNotes], [InterviewCancel], [DateComplete], [DateAdded], [AddedBy], [DateUpdated], [UpdatedBy], [InterviewRecurrenceKey], [InterviewRecurrence] FROM [Scheduler] WHERE (([InterviewComplete] = @InterviewComplete) AND ([InterviewCancel] = @InterviewCancel)) ORDER BY [InterviewDate] DESC, [InterviewTime] DESC" UpdateCommand="UPDATE Scheduler SET InterviewSubject = @Subject, InterviewTime = @Start, InterviewTimeEnd = @End , InterviewDate = @Date, InterviewNotes = @Notes, InterviewRecurrence = @RecurrenceRule, InterviewRecurrenceKey = @RecurrenceParentID WHERE (AppointmentID = @ID)">
<UpdateParameters>
<asp:Parameter Name="Subject" />
<asp:Parameter Name="Start" />
<asp:Parameter Name="End" />
<asp:Parameter Name="Date" />
<asp:Parameter Name="Notes" />
<asp:Parameter Name="RecurrenceRule" />
<asp:Parameter Name="RecurrenceParentID" />
<asp:Parameter Name="InterviewNotes" />
<asp:Parameter Name="IntervieweeID" />
<asp:Parameter Name="ID" />
</UpdateParameters>
<SelectParameters>
<asp:Parameter DefaultValue="False" Name="InterviewComplete" Type="Boolean" />
<asp:Parameter DefaultValue="False" Name="InterviewCancel" Type="Boolean" />
</SelectParameters>
</
asp:SqlDataSource>
<
asp:SqlDataSource ID="DetailsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:bclWebsiteConnectionString %>"
SelectCommand="SELECT [AppointmentID], [InterviewNotes], [IntervieweeID], [InterviewerID] FROM [Scheduler]"></asp:SqlDataSource>
<asp:SqlDataSource ID="InterviewerDetailsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:bclWebsiteConnectionString %>"SelectCommand="SELECT SurveyCompletorID, FirstName, LastName, FirstName + ' ' + LastName AS InterviewerName FROM Users"></asp:SqlDataSource>
<
br />
<
div>
<asp:ImageButton ID="RebindCalBtn" runat="server" ImageUrl="..\..\Images\Misc\ReloadBtn.gif" />
</
div>
Custom Attributes do not have the restriction which the appointment's properties have. You can bind controls to fields from RadScheduler's data source by column name. For example
<asp:Literal ID="InterviewerName" runat="server" Text='<%# Bind("InterviewerName") %>' /> |
This will work as long as you have a column in your RadSchedueler's data source called "InterviewerName" and you have set CustomAttributeNames="InterviewerName".
I noticed that the InterviewerName in your code comes from another data source and this will cause problems. The InterviewerName must be a column in the "bclwebsite" data source.
I hope this helps.
All the best,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
anyone still having an issue with this, ill throw in some more feedback.
Again please keep in mind that I am a "newbie" to .net and have only been working with .net for 3 months now. Thanks in advance for your help!