Hi,
I have seen the following example for deleting an appointment within an advanced edit template;
I have seen the following example for deleting an appointment within an advanced edit template;
<
script type="text/javascript">
function
DeleteAppointment()
{
var scheduler = $find("<%= Owner.ClientID %>");
var app = scheduler.get_currentAppointment();
scheduler.deleteAppointmentWithConfirmation(app);
scheduler.hideAdvancedForm();
return false;
}
</
script>
This example is used within a usercontrol, I have an advanced edit template within the aspx page as opposed to usercontrol, how could I use the above or similar in my advanced edit template to delete an appointment.
Thanks.
5 Answers, 1 is accepted
0
Hello Karl,
I am no sure what exactly your setup is. Can you be more specific and narrow down your question a bit? Do you get any errors when using the client API of RadScheduler?
Kind regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I am no sure what exactly your setup is. Can you be more specific and narrow down your question a bit? Do you get any errors when using the client API of RadScheduler?
Kind regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Karl
Top achievements
Rank 1
answered on 04 Aug 2009, 02:04 PM
I have a page (Default.aspx) that has the following code, I would like to add a Delete command/Delete functionality into the advanced edit template, but I am not sure how to go about it.
| <AdvancedEditTemplate> |
| <div class="formRow"> |
| <div class="formLabel"><asp:Label ID="Label1" AssociatedControlID="TitleTextBox" runat="server">Your Name</asp:Label></div> |
| <div class="formField"> |
| <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Subject") %>' |
| Width="200"></asp:TextBox> |
| <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please enter your name." ControlToValidate="TitleTextBox"></asp:RequiredFieldValidator> |
| </div> |
| </div> |
| <div class="formRow"> |
| <div class="formLabel"><asp:Label ID="Label4" AssociatedControlID="EmailTextBox" runat="server">Email Address</asp:Label></div> |
| <div class="formField"> |
| <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' |
| Width="200"></asp:TextBox> |
| <asp:RequiredFieldValidator ID="valEmailReq" runat="Server" ErrorMessage="Please provide a valid email address." ControlToValidate="EmailTextBox" Display="Dynamic" ForeColor="" CssClass="validator"></asp:RequiredFieldValidator> |
| <asp:RegularExpressionValidator ID="valEmailFormat" runat="Server" ErrorMessage="Please provide a valid email address." ControlToValidate="EmailTextBox" Display="Dynamic" ForeColor="" CssClass="validator" |
| ValidationExpression="^\s*[a-zA-Z_0-9_\.\!\#\$\%\*\+\-\/\=\?\^\`\{\|\}\~]+@[a-zA-Z_0-9\-]+\.[a-zA-Z_0-9\-]+(\.[a-zA-Z_0-9\-]+)*\s*$" /> |
| </div> |
| </div> |
| <div class="formRow"> |
| <div class="formLabel"><asp:Label ID="Label2" runat="server">Start date / time:</asp:Label></div> |
| <div class="formField"> |
| <telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server" SelectedDate='<%# Bind("Start") %>' TimeView-EndTime="18:59:59" TimeView-StartTime="08:00:00"> |
| </telerik:RadDateTimePicker> |
| <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Please enter the start date / time." ControlToValidate="RadDateTimePicker1"></asp:RequiredFieldValidator> |
| </div> |
| </div> |
| <div class="formRow"> |
| <div class="formLabel"><asp:Label ID="Label3" runat="server">End date / time:</asp:Label></div> |
| <div class="formField"> |
| <telerik:RadDateTimePicker ID="RadDateTimePicker2" runat="server" SelectedDate='<%# Bind("End") %>' TimeView-EndTime="18:59:59" TimeView-StartTime="08:00:00"> |
| </telerik:RadDateTimePicker> |
| <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Please enter the end date / time." ControlToValidate="RadDateTimePicker2"></asp:RequiredFieldValidator> |
| </div> |
| </div> |
| <div class="formRow"> |
| <div class="formLabel"><asp:Label ID="Label7" AssociatedControlID="locationTextBox" runat="server">Location Visiting</asp:Label></div> |
| <div class="formField"> |
| <asp:TextBox ID="locationTextBox" Rows="5" Columns="20" runat="server" Text='<%# Bind("location_visiting") %>' Width="200"></asp:TextBox> |
| <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Please specify where you are visiting." ControlToValidate="locationTextBox"></asp:RequiredFieldValidator> |
| </div> |
| </div> |
| <div class="formRow"> |
| <div class="formLabel"><asp:Label ID="Label5" AssociatedControlID="reasonTextBox" runat="server">Reason</asp:Label></div> |
| <div class="formField"> |
| <asp:TextBox ID="reasonTextBox" Rows="5" Columns="20" runat="server" Text='<%# Bind("reason") %>' TextMode="MultiLine" Width="200"></asp:TextBox> |
| <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Please enter the reason why you require the vehicle." ControlToValidate="reasonTextBox"></asp:RequiredFieldValidator> |
| </div> |
| </div> |
| <div class="formRow"> |
| <div class="formLabel"><asp:Label ID="Label6" AssociatedControlID="ccTextBox" runat="server">Cost Centre / Facility Code</asp:Label></div> |
| <div class="formField"> |
| <asp:TextBox ID="ccTextBox" runat="server" Text='<%# Bind("cost_centre") %>' |
| Width="100"></asp:TextBox> |
| <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Please enter your cost centre or facility code." ControlToValidate="ccTextBox"></asp:RequiredFieldValidator> |
| </div> |
| </div> |
| <div class="formRow" id="ZoneID1"> |
| <br /><br /> |
| <center> |
| <asp:Button ID="Button1" runat="server" Text="Approve Reservation" CommandName="Update"/> |
| <asp:Button ID="Button3" runat="server" Text="Reject Reservation" CommandName="Delete" /><! NEED THIS TO DELETE THE APPOINTMENT> |
| <asp:Button ID="Button2" runat="server" Text="Cancel" CommandName="Cancel"/> |
| </center> |
| </div> |
| </AdvancedEditTemplate> |
| </telerik:RadScheduler> |
0
Karl
Top achievements
Rank 1
answered on 05 Aug 2009, 02:04 PM
Any ideas on this? It's still giving me a headache!
Thanks a lot.
Thanks a lot.
0
Accepted
Hi Karl,
Please, try the following:
Regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Please, try the following:
| <AdvancedEditTemplate> |
| * * * |
| <asp:Button ID="Button2" runat="server" Text="Delete" onclick="Button2_Click" /> |
| </AdvancedEditTemplate> |
| protected void Button2_Click(object sender, EventArgs e) |
| { |
| SchedulerFormContainer container = (SchedulerFormContainer) ((Button)sender).BindingContainer; |
| RadScheduler1.DeleteAppointment(container.Appointment, true); |
| RadScheduler1.Rebind(); |
| } |
Regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Karl
Top achievements
Rank 1
answered on 05 Aug 2009, 02:59 PM
Many thanks a lot, all working great!