Hello,
I got a problem about using usercontrol in template for Scheduler. Below is the code in my template.
And the following is my usercontrol code.
I save the appointment data to database in AppointmentCommand() event. The code looks like:
After switching back to View mode, the finding indicates that only StartDate and EndDate for the new appointment are correct. The subject is always empty. Do you have any idea for the issue? Thanks.
I got a problem about using usercontrol in template for Scheduler. Below is the code in my template.
| <AdvancedInsertTemplate> |
| <div style="position: relative; background: #E6E6E6; height: 100%; border: 1px solid #666666;"> |
| <div style="margin-left: 10px; margin-top: 5px;"> |
| <uc1:ScheduleEditForm ID="ScheduleEditForm1" runat="server" /> |
| </div> |
| <div class="blueBox" style="margin-bottom: 5px; position: absolute; bottom: 0px"> |
| <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert"> |
| <asp:Image runat="server" ID="insertImage" ImageUrl="Images/Edit.gif" AlternateText="Insert" ToolTip="Insert" /></asp:LinkButton> |
| <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"> |
| <asp:Image runat="server" ID="cancelImage" ImageUrl="Images/cancel.gif" AlternateText="Cancel" ToolTip="Cancel" /></asp:LinkButton> |
| </div> |
| </div> |
| </AdvancedInsertTemplate> |
And the following is my usercontrol code.
| <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ScheduleEditForm.ascx.cs" Inherits="Controls_ScheduleEditForm" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"> |
| </asp:ScriptManagerProxy> |
| <fieldset> |
| <p class="form_p"> |
| <asp:Label ID="Field_Subject_Label" Text="Descrption:" runat="server" CssClass="form_label" AssociatedControlID="Field_Subject"></asp:Label> |
| <asp:TextBox ID="Field_Subject" Rows="5" Columns="40" runat="server" Text='<%# Bind("Subject") %>' TextMode="MultiLine" CssClass="form_input"></asp:TextBox> |
| </p> |
| <p class="form_p"> |
| <asp:Label ID="Field_Start_Label" Text="Start time:" runat="server" CssClass="form_label" AssociatedControlID="Field_Start"></asp:Label> |
| <telerik:RadDateTimePicker ID="Field_Start" runat="server"> |
| </telerik:RadDateTimePicker> |
| </p> |
| <p class="form_p"> |
| <asp:Label ID="Field_End_Label" Text="End time:" runat="server" CssClass="form_label" AssociatedControlID="Field_End"></asp:Label> |
| <telerik:RadDateTimePicker ID="Field_End" runat="server"> |
| </telerik:RadDateTimePicker> |
| </p> |
| <p class="form_p"> |
| <asp:Label ID="Field_CompletedRatio_Label" Text="Completed Ratio:" runat="server" CssClass="form_label" AssociatedControlID="Field_CompletedRatio"></asp:Label> |
| <span style="float:left;margin-right:10px"> |
| <asp:TextBox ID="Field_CompletedRatio" runat="server" CssClass="form_slider">1</asp:TextBox> |
| <ajaxToolkit:SliderExtender ID="SliderExtender1" runat="server" Minimum="1" Maximum="100" BoundControlID="Field_CompletedRatio_Value" TargetControlID="Field_CompletedRatio"> |
| </ajaxToolkit:SliderExtender> |
| </span> |
| <asp:TextBox ID="Field_CompletedRatio_Value" runat="server" ReadOnly="true" Text="1" Width="25"></asp:TextBox> |
| </p> |
| </fieldset> |
I save the appointment data to database in AppointmentCommand() event. The code looks like:
| protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e) |
| { |
| if (e.CommandName == "Insert") |
| { |
| Controls_ScheduleEditForm insertForm = (Controls_ScheduleEditForm)e.Container.FindControl("ScheduleEditForm1"); |
| insertForm.prepare(); |
| insert((RadScheduler)sender, e.Container.Appointment); |
| } |
| } |
After switching back to View mode, the finding indicates that only StartDate and EndDate for the new appointment are correct. The subject is always empty. Do you have any idea for the issue? Thanks.