Hi,
Notice the CustomAttributeNames="Donors"
The SurName of the donor is not displayed, but there is no error message either?
In my appointment I require a custom field. My schedulers datasource is an EntityDataSource, with one of the entity properties of the appointment is a "donors", another entity.This "donors" propertie must be bound to a RadComboBox which contains a selection of donors in the insert/edit templates of the appointement.
I inserted an appointment directly in the database for testing purposes (so I can atleast show the appointment)
So my scheduler defenition looks like this:
<telerik:RadScheduler runat="server" ID="rsDonationSchedule" DayStartTime="08:00:00" |
DayEndTime="18:00:00" TimeZoneOffset="03:00:00" DataSourceID="edsDonationSchedule" |
DataKeyField="DonationScheduleId" DataStartField="Start" DataEndField="End" DataSubjectField="Subject" |
CustomAttributeNames="Donors" OnAppointmentInsert="rsDonationSchedule_OnAppointmentInsert" > |
<AdvancedForm Modal="true" /> |
Now when I use the AppointmentTemplate like this:
<AppointmentTemplate> |
<%# Eval("Subject") %><%# Eval("Donors.SurName")%> |
</AppointmentTemplate> |
I can't get an appointment inserted (or updated) either....
<InlineInsertTemplate> |
<span> |
<table> |
<tr> |
<td> |
<asp:Label ID="Label3" AssociatedControlID="TitleTextBox" runat="server">Onderwerp</asp:Label><asp:TextBox |
ID="TitleTextBox" runat="server" Text='<%# Bind("Subject") %>' Width="90%" Height="20px"></asp:TextBox> |
</td> |
</tr> |
<tr> |
<td> |
<asp:Label ID="Label4" AssociatedControlID="rcbDonors" runat="server">Donor</asp:Label><telerik:RadComboBox |
ID="rcbDonors" runat="server" DataSourceID="edsDonoren" DataTextField="DonorScheduleLabel" |
DataValueField="DonorId" MarkFirstMatch="true" SelectedValue="<%# Bind('Donors.DonorId') %>" /> |
</td> |
</tr> |
<tr> |
<td> |
<asp:Label ID="Label5" AssociatedControlID="txtDescription" runat="server">Info</asp:Label><asp:TextBox |
ID="txtDescription" runat="server" Text='<%# Bind("Description") %>' Width="90%" |
TextMode="MultiLine" Height="20px"></asp:TextBox> |
</td> |
</tr> |
<tr> |
<td> |
<asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert"> |
<asp:Image runat="server" ID="insertImage" ImageUrl="Images/ok.png" AlternateText="insert" /> |
</asp:LinkButton> |
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"> |
<asp:Image runat="server" ID="Image2" ImageUrl="Images/cancel.png" AlternateText="cancel" /> |
</asp:LinkButton> |
</td> |
</tr> |
</table> |
</span> |
</InlineInsertTemplate> |
There's an error message on the datasource inserting event (void edsDonationSchedule_Inserting(object sender, EntityDataSourceChangingEventArgs e)):
Exception {"Error while setting property 'Donors': 'This property descriptor does not support the SetValue method.'."} System.Exception {System.Web.UI.WebControls.EntityDataSourceValidationException}
I think need to set the DonorsReferenceEntityKey upon saving, but how would I do this?
When I catch event OnAppointmentCommand from my scheduler, I can add attributes, but adding "DonorsId" or "Donors.DonorsId" will fail since these are not properties off my appointment entity. Donors is, but it is an object, and it looks like I can only add "string" attributes...
Do I need to abandon the EF path?