Hi All,
Sorry for repeating the post here again,but found this forum to be more specific for scheduler.
I'm using a RadEditor inside a AdvanceEditTemplate of RadScheduler. When i update the description inside the RadEditor and click on Save, the AppointmentUpdate events fires but does not fetch the updated data. Can anyone help me in what is missing in the code. Posted the code below for reference. Appreciate any immediate help.Thanks in advance.
Aspx Page:
<telerik:RadScheduler ID="rschEvents" runat="server" Height="100%" Skin="Office2007"
Width="100%" FirstDayOfWeek="Sunday" MonthVisibleAppointmentsPerDay="5" OverflowBehavior="Expand"
RowHeight="25px" SelectedView="MonthView" EnableRecurrenceSupport="False" LastDayOfWeek="Saturday"
OnAppointmentInsert="rschEvents_AppointmentInsert" EnableAdvancedForm="True"
StartInsertingInAdvancedForm="True" CustomAttributeNames="Description" EnableCustomAttributeEditing="False"
OnAppointmentDelete="rschEvents_AppointmentDelete" OnAppointmentUpdate="rschEvents_AppointmentUpdate"
OnAppointmentClick="rschEvents_AppointmentClick" OnAppointmentCommand="rschEvents_AppointmentCommand"
OnAppointmentCreated="rschEvents_AppointmentCreated" OnNavigationCommand="rschEvents_NavigationCommand"
Style="top: 3px; left: 0px">
<MonthView VisibleAppointmentsPerDay="5" ColumnHeaderDateFormat="dddd" HeaderDateFormat="MMMM, yyyy" />
<AdvancedEditTemplate>
<div>
<table align="center" border="0" width="95%" cellpadding="5" cellspacing="0">
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDescription" runat="server" Text="Description" Font-Bold="true">
</asp:Label>
</td>
</tr>
<tr>
<td>
<telerik:RadEditor EditModes="All" Enabled="true" ID="radEditor" runat="server" Html='<%#Eval("Subject")%>'>
</telerik:RadEditor>
</td>
</tr>
<tr>
<td>
<table width="20%" align="left" cellpadding="1" cellspacing="1">
<tr>
<td width="50%">
<asp:Label ID="lblDate" AssociatedControlID="rdtpFrom" runat="server" Text="From Date"
Font-Bold="true"></asp:Label>
</td>
<td align="left">
<telerik:RadDateTimePicker ID="rdtpFrom" runat="server" DateInput-ReadOnly="true"
SelectedDate='<%# Eval("Start") %>' TimeView-Columns="4">
</telerik:RadDateTimePicker>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="20%" align="left" cellpadding="1" cellspacing="1">
<tr>
<td width="50%">
<asp:Label ID="lblDate1" AssociatedControlID="rdtpTo" runat="server" Text="To Date"
Font-Bold="true"></asp:Label>
</td>
<td align="left">
<telerik:RadDateTimePicker ID="rdtpTo" runat="server" DateInput-ReadOnly="true" SelectedDate='<%# Eval("End") %>'
TimeView-Columns="4">
</telerik:RadDateTimePicker>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td>
<asp:LinkButton ID="btnCancel" runat="server" CssClass="button_Default" OnClick="btnCancel_Click">Cancel</asp:LinkButton> <asp:LinkButton
ID="btnSave" runat="server" CssClass="button_Default" CommandName="Update">Save</asp:LinkButton>
</td>
</tr>
</table>
</div>
</AdvancedEditTemplate>
</telerik:RadScheduler>
Aspx.cs page:
protected void rschEvents_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e)
{
if (e.Appointment.Subject != String.Empty)
{
CalendarEvent ce = CalendarEvent.FindByEventId(e.Appointment.ID.ToString());
ce.Data.EventSubject = e.ModifiedAppointment.Subject.ToString();
ce.Data.StartDate = e.ModifiedAppointment.Start.ToString();
ce.Data.EndDate = e.ModifiedAppointment.End.ToString();
ce.Data.EventTitle = txtEventTitle.Text.ToString();
ce.Update();
LoadCalendarEvents();
}
else
{
e.Cancel = true;
}
I'm using a RadEditor inside a AdvanceEditTemplate of RadScheduler. When i update the description inside the RadEditor and click on Save, the AppointmentUpdate events fires but does not fetch the updated data. Can anyone help me in what is missing in the code. Posted the code below for reference. Appreciate any immediate help.Thanks in advance.
Aspx Page:
<telerik:RadScheduler ID="rschEvents" runat="server" Height="100%" Skin="Office2007"
Width="100%" FirstDayOfWeek="Sunday" MonthVisibleAppointmentsPerDay="5" OverflowBehavior="Expand"
RowHeight="25px" SelectedView="MonthView" EnableRecurrenceSupport="False" LastDayOfWeek="Saturday"
OnAppointmentInsert="rschEvents_AppointmentInsert" EnableAdvancedForm="True"
StartInsertingInAdvancedForm="True" CustomAttributeNames="Description" EnableCustomAttributeEditing="False"
OnAppointmentDelete="rschEvents_AppointmentDelete" OnAppointmentUpdate="rschEvents_AppointmentUpdate"
OnAppointmentClick="rschEvents_AppointmentClick" OnAppointmentCommand="rschEvents_AppointmentCommand"
OnAppointmentCreated="rschEvents_AppointmentCreated" OnNavigationCommand="rschEvents_NavigationCommand"
Style="top: 3px; left: 0px">
<MonthView VisibleAppointmentsPerDay="5" ColumnHeaderDateFormat="dddd" HeaderDateFormat="MMMM, yyyy" />
<AdvancedEditTemplate>
<div>
<table align="center" border="0" width="95%" cellpadding="5" cellspacing="0">
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDescription" runat="server" Text="Description" Font-Bold="true">
</asp:Label>
</td>
</tr>
<tr>
<td>
<telerik:RadEditor EditModes="All" Enabled="true" ID="radEditor" runat="server" Html='<%#Eval("Subject")%>'>
</telerik:RadEditor>
</td>
</tr>
<tr>
<td>
<table width="20%" align="left" cellpadding="1" cellspacing="1">
<tr>
<td width="50%">
<asp:Label ID="lblDate" AssociatedControlID="rdtpFrom" runat="server" Text="From Date"
Font-Bold="true"></asp:Label>
</td>
<td align="left">
<telerik:RadDateTimePicker ID="rdtpFrom" runat="server" DateInput-ReadOnly="true"
SelectedDate='<%# Eval("Start") %>' TimeView-Columns="4">
</telerik:RadDateTimePicker>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="20%" align="left" cellpadding="1" cellspacing="1">
<tr>
<td width="50%">
<asp:Label ID="lblDate1" AssociatedControlID="rdtpTo" runat="server" Text="To Date"
Font-Bold="true"></asp:Label>
</td>
<td align="left">
<telerik:RadDateTimePicker ID="rdtpTo" runat="server" DateInput-ReadOnly="true" SelectedDate='<%# Eval("End") %>'
TimeView-Columns="4">
</telerik:RadDateTimePicker>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td>
<asp:LinkButton ID="btnCancel" runat="server" CssClass="button_Default" OnClick="btnCancel_Click">Cancel</asp:LinkButton> <asp:LinkButton
ID="btnSave" runat="server" CssClass="button_Default" CommandName="Update">Save</asp:LinkButton>
</td>
</tr>
</table>
</div>
</AdvancedEditTemplate>
</telerik:RadScheduler>
Aspx.cs page:
protected void rschEvents_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e)
{
if (e.Appointment.Subject != String.Empty)
{
CalendarEvent ce = CalendarEvent.FindByEventId(e.Appointment.ID.ToString());
ce.Data.EventSubject = e.ModifiedAppointment.Subject.ToString();
ce.Data.StartDate = e.ModifiedAppointment.Start.ToString();
ce.Data.EndDate = e.ModifiedAppointment.End.ToString();
ce.Data.EventTitle = txtEventTitle.Text.ToString();
ce.Update();
LoadCalendarEvents();
}
else
{
e.Cancel = true;
}
Also
added a FormCreated event and checked...i was not able to get the
content nor the date field values. Below code for reference.
Can anyone tell me what is the mistake being done?
protected void rschEvents_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
{
RadScheduler scheduler = (RadScheduler)sender;
if (e.Container.Mode == SchedulerFormMode.Insert ||
e.Container.Mode == SchedulerFormMode.AdvancedInsert)
{
RadEditor editor = (RadEditor)e.Container.FindControl("radEditorInsert");
//editor.Content = (RadEditor)e.Container.FindControl("radEditorInsert");
}
if (e.Container.Mode == SchedulerFormMode.AdvancedInsert)
{
//TextBox subjectBox = (TextBox)e.Container.FindControl("SubjectTextBox");
//subjectBox.Text = e.Appointment.Subject;
RadDateTimePicker startInput = (RadDateTimePicker)e.Container.FindControl("rdtpFromInsert");
startInput.SelectedDate = this.rschEvents.DisplayToUtc(e.Appointment.Start);
RadDateTimePicker endInput = (RadDateTimePicker)e.Container.FindControl("rdtpToInsert");
endInput.SelectedDate = this.rschEvents.DisplayToUtc(e.Appointment.End);
}
}
Thanks,
Sri
Sri