Hi..
I have a problem with my custom edit/insert template, template doesnt use Bind in aspx, all values are retrieved by AppointmantCommand event handler.
I have a few problems:
protected void radSch_AppCommand(object sender, AppointmentCommandEventArgs e)
{
if (e.CommandName == "Insert" || e.CommandName=="Update")
{
TextBox txtName = (TextBox)e.Container.FindControl("txtName");
e.Container.Appointment.Subject = txtName.Text;
Here subject is loaded into appointment object..
protected void radSch_AppInsert(object sender, SchedulerCancelEventArgs e)
{
if ((e.Appointment.Start > e.Appointment.End) || (e.Appointment.Subject == String.Empty))
{
e.Cancel = true;
return;
}
e.Appointment.Attributes["UserId"] = UserId.ToString();
}
Here in AppointmentInsert subject is blank, looks like it loaded a text from external control or from some other place, but it WAS loaded correctly in event below. What is wrong?
2) There is also a problem with changing existing appointments, start/end date doesnt get updated. All data is correctly updated in appointment command event but laters it backs to orginal values.
3) Looks like Appointments attributes are lost during updates too, i had to readd it on every update.
4) Last problem, how to implemenent appointment delete in my custom template?
My radscheduler:
<telerik:RadScheduler Skin="Office2007" runat="server" ID="radSch"
Width="100%" DataEndField="End" DataStartField="Start" DataSourceID="SchedulerDataSource"
DataKeyField="ID" DataSubjectField="Name" Height="100%" DataRecurrenceField="RecurrenceRule"
DataRecurrenceParentKeyField="RecurrenceParentID" SelectedView="WeekView" OnAppointmentUpdate="radSch_AppUpdate"
OnAppointmentCommand="radSch_AppCommand" AllowDelete="True" AllowEdit="True"
AllowInsert="True" HoursPanelTimeFormat="HH:mm" SelectedDate="2007-10-27"
OnAppointmentInsert="radSch_AppInsert" OnFormCreated="radSch_FormCreated" StartEditingInAdvancedForm="true"
StartInsertingInAdvancedForm="true">
<AdvancedEditTemplate>
<table style="width: 100%; border: solid 1px #637783">
<tr class="schEditRow">
<td>
Informacje podstawowe
</td>
</tr>
<tr>
<td>
Nazwa:
</td>
</tr>
<tr>
<td>
<asp:TextBox Width="100%" runat="server" ID="txtName"
MaxLength="100" />
</td>
</tr>
<tr>
<td>
Opis:
</td>
</tr>
<tr>
<td>
<asp:TextBox Width="100%" runat="server" ID="txtDesc" MaxLength="4000" TextMode="MultiLine"
Rows="4"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Od:
<radCln:RadDateTimePicker ID="diStart" runat="server" />
Do:
<radCln:RadDateTimePicker ID="diEnd" runat="server" />
<asp:CheckBox runat="server" ID="cbAllDay" Text="Wydarzenie całodniowe" />
</td>
</tr>
<tr class="schEditRow">
<td>
Powtarzalność
</td>
</tr>
<tr>
<td>
<asp:CheckBox runat="server" ID="cbRepeat" Text="Powtarzaj" />
</td>
</tr>
<tr>
<td>
Co:
<asp:TextBox runat="server" ID="txtReccDelay" />
<asp:RadioButtonList runat="server" ID="rbReccurency">
<asp:ListItem Text="Godzinowo" Value="1" Selected="true"></asp:ListItem>
<asp:ListItem Text="Dziennie" Value="2"></asp:ListItem>
<asp:ListItem Text="Tygodniowo" Value="3"></asp:ListItem>
<asp:ListItem Text="Miesięcznie" Value="4"></asp:ListItem>
<asp:ListItem Text="Rocznie" Value="5"></asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>
Zakres potwórzeń:
</td>
</tr>
<tr>
<td>
<asp:RadioButton GroupName="Repeat" runat="server" ID="rbNoEnd" Text="Bez daty końcowej" /><br />
<asp:RadioButton GroupName="Repeat" runat="server" ID="rbCount" Text="Zakończ po: " />
<asp:TextBox runat="server" ID="txtRepeatC"></asp:TextBox>
potwórzeniach<br />
<asp:RadioButton GroupName="Repeat" runat="server" ID="rbDate" Text="Zakończ dnia: " />
<radCln:RadDatePicker Width="110px" ID="rdpDate" runat="server" />
</td>
</tr>
<tr class="schEditRow">
<td>
Uprawnienia
</td>
</tr>
<tr>
<td>
<uc:parti runat="server" ID="ucParti" />
</td>
</tr>
<tr>
<td>
<asp:LinkButton CommandName="Update" runat="server" ID="lbSave" Text="Zapisz" />
<asp:LinkButton CommandName="Delete" runat="server" ID="lbDelete" Text="Usuń" />
<asp:LinkButton CommandName="Cancel" runat="server" ID="lbCancel" Text="Anuluj" />
</td>
</tr>
</table>
</AdvancedEditTemplate>
<AdvancedInsertTemplate>
<table style="width: 100%; border: solid 1px #637783">
<tr class="schEditRow">
<td>
Informacje podstawowe
</td>
</tr>
<tr>
<td>
Nazwa:
</td>
</tr>
<tr>
<td>
<asp:TextBox Width="100%" runat="server" ID="txtName"
MaxLength="100" />
</td>
</tr>
<tr>
<td>
Opis:
</td>
</tr>
<tr>
<td>
<asp:TextBox Width="100%" runat="server" ID="txtDesc" MaxLength="4000" TextMode="MultiLine"
Rows="4"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<radCln:RadDateTimePicker ID="diStart" runat="server" />
Do:
<radCln:RadDateTimePicker ID="diEnd" runat="server" />
<asp:CheckBox runat="server" ID="cbAllDay" Text="Wydarzenie całodniowe" />
</td>
</tr>
<tr class="schEditRow">
<td>
Powtarzalność
</td>
</tr>
<tr>
<td>
<asp:CheckBox runat="server" ID="cbRepeat" Text="Powtarzaj" />
</td>
</tr>
<tr>
<td>
Co:
<asp:TextBox runat="server" ID="txtReccDelay" />
<asp:RadioButtonList runat="server" ID="rbReccurency">
<asp:ListItem Text="Godzinowo" Value="1" Selected="true"></asp:ListItem>
<asp:ListItem Text="Dziennie" Value="2"></asp:ListItem>
<asp:ListItem Text="Tygodniowo" Value="3"></asp:ListItem>
<asp:ListItem Text="Miesięcznie" Value="4"></asp:ListItem>
<asp:ListItem Text="Rocznie" Value="5"></asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>
Zakres potwórzeń:
</td>
</tr>
<tr>
<td>
<asp:RadioButton runat="server" ID="rbNoEnd" Text="Bez daty końcowej" /><br />
<asp:RadioButton runat="server" ID="rbCount" Text="Zakończ po: " />
<asp:TextBox runat="server" ID="txtRepeatC"></asp:TextBox>
potwórzeniach<br />
<asp:RadioButton runat="server" ID="rbDate" Text="Zakończ dnia: " />
<radCln:RadDatePicker Width="110px" ID="rdpDate" runat="server" />
</td>
</tr>
<tr class="schEditRow">
<td>
Uprawnienia
</td>
</tr>
<tr>
<td>
<uc:parti runat="server" ID="ucParti" />
</td>
</tr>
<tr>
<td>
<asp:LinkButton CommandName="Insert" runat="server" ID="lbSave" Text="Zapisz" />
<asp:LinkButton CommandName="Cancel" runat="server" ID="lbCancel" Text="Anuluj" />
</td>
</tr>
</table>
</AdvancedInsertTemplate>
</telerik:RadScheduler>
Thanks for attention. Regards
I have a problem with my custom edit/insert template, template doesnt use Bind in aspx, all values are retrieved by AppointmantCommand event handler.
I have a few problems:
protected void radSch_AppCommand(object sender, AppointmentCommandEventArgs e)
{
if (e.CommandName == "Insert" || e.CommandName=="Update")
{
TextBox txtName = (TextBox)e.Container.FindControl("txtName");
e.Container.Appointment.Subject = txtName.Text;
Here subject is loaded into appointment object..
protected void radSch_AppInsert(object sender, SchedulerCancelEventArgs e)
{
if ((e.Appointment.Start > e.Appointment.End) || (e.Appointment.Subject == String.Empty))
{
e.Cancel = true;
return;
}
e.Appointment.Attributes["UserId"] = UserId.ToString();
}
Here in AppointmentInsert subject is blank, looks like it loaded a text from external control or from some other place, but it WAS loaded correctly in event below. What is wrong?
2) There is also a problem with changing existing appointments, start/end date doesnt get updated. All data is correctly updated in appointment command event but laters it backs to orginal values.
3) Looks like Appointments attributes are lost during updates too, i had to readd it on every update.
4) Last problem, how to implemenent appointment delete in my custom template?
My radscheduler:
<telerik:RadScheduler Skin="Office2007" runat="server" ID="radSch"
Width="100%" DataEndField="End" DataStartField="Start" DataSourceID="SchedulerDataSource"
DataKeyField="ID" DataSubjectField="Name" Height="100%" DataRecurrenceField="RecurrenceRule"
DataRecurrenceParentKeyField="RecurrenceParentID" SelectedView="WeekView" OnAppointmentUpdate="radSch_AppUpdate"
OnAppointmentCommand="radSch_AppCommand" AllowDelete="True" AllowEdit="True"
AllowInsert="True" HoursPanelTimeFormat="HH:mm" SelectedDate="2007-10-27"
OnAppointmentInsert="radSch_AppInsert" OnFormCreated="radSch_FormCreated" StartEditingInAdvancedForm="true"
StartInsertingInAdvancedForm="true">
<AdvancedEditTemplate>
<table style="width: 100%; border: solid 1px #637783">
<tr class="schEditRow">
<td>
Informacje podstawowe
</td>
</tr>
<tr>
<td>
Nazwa:
</td>
</tr>
<tr>
<td>
<asp:TextBox Width="100%" runat="server" ID="txtName"
MaxLength="100" />
</td>
</tr>
<tr>
<td>
Opis:
</td>
</tr>
<tr>
<td>
<asp:TextBox Width="100%" runat="server" ID="txtDesc" MaxLength="4000" TextMode="MultiLine"
Rows="4"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Od:
<radCln:RadDateTimePicker ID="diStart" runat="server" />
Do:
<radCln:RadDateTimePicker ID="diEnd" runat="server" />
<asp:CheckBox runat="server" ID="cbAllDay" Text="Wydarzenie całodniowe" />
</td>
</tr>
<tr class="schEditRow">
<td>
Powtarzalność
</td>
</tr>
<tr>
<td>
<asp:CheckBox runat="server" ID="cbRepeat" Text="Powtarzaj" />
</td>
</tr>
<tr>
<td>
Co:
<asp:TextBox runat="server" ID="txtReccDelay" />
<asp:RadioButtonList runat="server" ID="rbReccurency">
<asp:ListItem Text="Godzinowo" Value="1" Selected="true"></asp:ListItem>
<asp:ListItem Text="Dziennie" Value="2"></asp:ListItem>
<asp:ListItem Text="Tygodniowo" Value="3"></asp:ListItem>
<asp:ListItem Text="Miesięcznie" Value="4"></asp:ListItem>
<asp:ListItem Text="Rocznie" Value="5"></asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>
Zakres potwórzeń:
</td>
</tr>
<tr>
<td>
<asp:RadioButton GroupName="Repeat" runat="server" ID="rbNoEnd" Text="Bez daty końcowej" /><br />
<asp:RadioButton GroupName="Repeat" runat="server" ID="rbCount" Text="Zakończ po: " />
<asp:TextBox runat="server" ID="txtRepeatC"></asp:TextBox>
potwórzeniach<br />
<asp:RadioButton GroupName="Repeat" runat="server" ID="rbDate" Text="Zakończ dnia: " />
<radCln:RadDatePicker Width="110px" ID="rdpDate" runat="server" />
</td>
</tr>
<tr class="schEditRow">
<td>
Uprawnienia
</td>
</tr>
<tr>
<td>
<uc:parti runat="server" ID="ucParti" />
</td>
</tr>
<tr>
<td>
<asp:LinkButton CommandName="Update" runat="server" ID="lbSave" Text="Zapisz" />
<asp:LinkButton CommandName="Delete" runat="server" ID="lbDelete" Text="Usuń" />
<asp:LinkButton CommandName="Cancel" runat="server" ID="lbCancel" Text="Anuluj" />
</td>
</tr>
</table>
</AdvancedEditTemplate>
<AdvancedInsertTemplate>
<table style="width: 100%; border: solid 1px #637783">
<tr class="schEditRow">
<td>
Informacje podstawowe
</td>
</tr>
<tr>
<td>
Nazwa:
</td>
</tr>
<tr>
<td>
<asp:TextBox Width="100%" runat="server" ID="txtName"
MaxLength="100" />
</td>
</tr>
<tr>
<td>
Opis:
</td>
</tr>
<tr>
<td>
<asp:TextBox Width="100%" runat="server" ID="txtDesc" MaxLength="4000" TextMode="MultiLine"
Rows="4"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<radCln:RadDateTimePicker ID="diStart" runat="server" />
Do:
<radCln:RadDateTimePicker ID="diEnd" runat="server" />
<asp:CheckBox runat="server" ID="cbAllDay" Text="Wydarzenie całodniowe" />
</td>
</tr>
<tr class="schEditRow">
<td>
Powtarzalność
</td>
</tr>
<tr>
<td>
<asp:CheckBox runat="server" ID="cbRepeat" Text="Powtarzaj" />
</td>
</tr>
<tr>
<td>
Co:
<asp:TextBox runat="server" ID="txtReccDelay" />
<asp:RadioButtonList runat="server" ID="rbReccurency">
<asp:ListItem Text="Godzinowo" Value="1" Selected="true"></asp:ListItem>
<asp:ListItem Text="Dziennie" Value="2"></asp:ListItem>
<asp:ListItem Text="Tygodniowo" Value="3"></asp:ListItem>
<asp:ListItem Text="Miesięcznie" Value="4"></asp:ListItem>
<asp:ListItem Text="Rocznie" Value="5"></asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>
Zakres potwórzeń:
</td>
</tr>
<tr>
<td>
<asp:RadioButton runat="server" ID="rbNoEnd" Text="Bez daty końcowej" /><br />
<asp:RadioButton runat="server" ID="rbCount" Text="Zakończ po: " />
<asp:TextBox runat="server" ID="txtRepeatC"></asp:TextBox>
potwórzeniach<br />
<asp:RadioButton runat="server" ID="rbDate" Text="Zakończ dnia: " />
<radCln:RadDatePicker Width="110px" ID="rdpDate" runat="server" />
</td>
</tr>
<tr class="schEditRow">
<td>
Uprawnienia
</td>
</tr>
<tr>
<td>
<uc:parti runat="server" ID="ucParti" />
</td>
</tr>
<tr>
<td>
<asp:LinkButton CommandName="Insert" runat="server" ID="lbSave" Text="Zapisz" />
<asp:LinkButton CommandName="Cancel" runat="server" ID="lbCancel" Text="Anuluj" />
</td>
</tr>
</table>
</AdvancedInsertTemplate>
</telerik:RadScheduler>
Thanks for attention. Regards