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

get value of control in RadScheduler1_AppointmentUpdate

1 Answer 57 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Vishal Dalsania
Top achievements
Rank 1
Vishal Dalsania asked on 29 Nov 2008, 12:38 PM
Hello,
 I am using AdvancedEditTemplate for edit and insert in scheduler. and I have added new controls(text box) for description, comment.
Now when RadScheduler1_AppointmentUpdate is fired, how i can get the values of this text box controls.
See the below code of AdvancedEditTemplate.
<AdvancedEditTemplate>
                                <div id="qsfexAdvEditWrapper">
                                    <div id="qsfexAdvEditInnerWrapper">
                                        <div class="qsfexAdvEditControlWrapper">
                                            <asp:Label ID="Label1" runat="server" CssClass="inline-label">Subject</asp:Label>
                                            <asp:TextBox ID="SubjectTextBox" Rows="5" Columns="20" runat="server" Text='<%# Bind("Subject") %>'
                                                Width="95%" TextMode="MultiLine"></asp:TextBox><br />
                                        </div>
                                        <div class="qsfexAdvEditControlWrapper">
                                            <asp:Label ID="Label4" runat="server" CssClass="inline-label">Description</asp:Label>
                                            <asp:TextBox ID="TextBox1" Text='<%# Bind("Description") %>' runat="server"></asp:TextBox>
                                        </div>
                                        <div class="qsfexAdvEditControlWrapper">
                                            <asp:Label ID="Label2" runat="server" CssClass="inline-label">Start time:</asp:Label>
                                            <telerik:RadDateInput ID="StartInput" SelectedDate='<%# Bind("Start") %>' runat="server">
                                            </telerik:RadDateInput><br />
                                        </div>
                                        <div class="qsfexAdvEditControlWrapper">
                                            <asp:Label ID="Label3" runat="server" CssClass="inline-label">End time:</asp:Label>
                                            <telerik:RadDateInput ID="EndInput" SelectedDate='<%# Bind("End") %>' runat="server">
                                            </telerik:RadDateInput><br />
                                        </div>
                                        <div class="qsfexAdvEditControlWrapper">
                                            <div class="inline-label">
                                                Color code:</div>
                                            <div id="qsfexAdvEditColorCodeChooser">
                                            </div>
                                        </div>
                                        <div class="qsfexAdvEditControlWrapper">
                                            <asp:CheckBox ID="RepeatCheckBox" runat="server" Text="Repeat for 10 days" />
                                        </div>
                                        <div class="qsfexAdvEditControlWrapper" style="text-align: right">
                                            <asp:LinkButton ID="UpdateButton" runat="server" CommandName="Update">
                                                <asp:Image runat="server" ID="insertImage" ImageUrl="Images/ok.gif" AlternateText="update" /></asp:LinkButton>
                                            <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel">
                                                <asp:Image runat="server" ID="Image2" ImageUrl="Images/cancel.gif" AlternateText="cancel" /></asp:LinkButton>
                                        </div>
                                             <asp:Button ID="btnUpdate" CommandName="Update" runat="server" />
                                          
                                    </div>
                                </div>
                            </AdvancedEditTemplate>
-----------------------------------------------------------------------------------------------------------------------------------
Below is the event that i am using for updating the record. Here i want the value of description also (see the commented line).
//AppointmentsDataSource.UpdateParameters["Description"].DefaultValue = e.ModifiedAppointment.????????;
-----------------------------------------------------------------------------------------------------------------------------------
protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
    {
        RadCalendar1.SpecialDays.Clear();
        RadCalendar2.SpecialDays.Clear();
        RadCalendar3.SpecialDays.Clear();
        AppointmentsDataSource.UpdateParameters["Subject"].DefaultValue = e.ModifiedAppointment.Subject;
        //AppointmentsDataSource.UpdateParameters["Description"].DefaultValue = e.ModifiedAppointment.????????;
        AppointmentsDataSource.UpdateParameters["Start"].DefaultValue = e.ModifiedAppointment.Start.ToString();
        if (e.Appointment.End != null)
            AppointmentsDataSource.UpdateParameters["End"].DefaultValue = e.ModifiedAppointment.End.ToString();
        AppointmentsDataSource.UpdateParameters["ID"].DefaultValue = e.ModifiedAppointment.ID.ToString();
        AppointmentsDataSource.Update();
}
-----------------------------------------------------------------------------------------------------------------------------------
Can you guide me how i can find this control in RadScheduler1_AppointmentUpdate and RadScheduler1_AppointmentInsert events.

Thanks


1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 01 Dec 2008, 12:24 PM
Hello Vishal,

We have already replied with a demo project in the support ticket you started. We suggested you use custom attributes. For example:

  <telerik:RadScheduler ID="RadScheduler1" runat="server" 
    CustomAttributeNames="Description" ...> 


  protected void RadScheduler1_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e)  
    {  
        Label5.Text = "Modified subject: " + e.ModifiedAppointment.Subject + "; Modified description: " + e.ModifiedAppointment.Attributes["Description"];  
    } 



Greetings,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Vishal Dalsania
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or