This is a migrated thread and some comments may be shown as answers.

[Solved] Usercontrol in custom template

1 Answer 217 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Joe Ma
Top achievements
Rank 1
Joe Ma asked on 20 Nov 2007, 11:11 AM
Hello,

    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> 
    <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> 
    <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> 
    <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> 
    <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.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 23 Nov 2007, 02:40 PM

Hi Joe,

Could you please open a support ticket and send us a project. We cannot tell what might be wrong because we don't have the complete implementation.


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
Joe Ma
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or