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

[Solved] insert/update appointments with a customize template

1 Answer 131 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
julien royer
Top achievements
Rank 1
julien royer asked on 04 Feb 2010, 01:34 PM
Hi,

I want to insert/update appointements in a customize template.

I have created an inline template and add somme new attributes like this :
<InlineInsertTemplate> 
       <div id="InlineInsertTemplate"
                 <table> 
                    [... Other code with date and event's description ...] 
                        <tr id="quid"
                                <td> 
                                    <asp:Label ID="lbl_quid_advanced_insertion" runat="server" Text="Civ, Nom, Prénom : "></asp:Label> 
                                </td> 
                                <td style="width:auto;">      
                                    <asp:DropDownList ID="ddl_civilite" runat="server"
                                        <asp:ListItem>Mlle</asp:ListItem> 
                                        <asp:ListItem>Madame</asp:ListItem> 
                                        <asp:ListItem>Monsieur</asp:ListItem> 
                                    </asp:DropDownList> 
                                </td> 
                                <td>      
                                    <asp:TextBox ID="TxtNomComplet" runat="server"></asp:TextBox> 
                                </td> 
                            </tr> 
                            <tr id="identifiant"
                                <td> 
                                    <asp:Label ID="lbl_identifiant_advanced_insertion" runat="server" Text="Identifiant (ex : Carte de fidélité) : "></asp:Label> 
                                </td> 
                                <td>      
                                    <asp:TextBox ID="txt_identifiant_advanced_insertion" runat="server"></asp:TextBox> 
                                </td> 
                            </tr> 
                            <tr id="tel1"
                                <td> 
                                    <asp:Label ID="lbl_tel1_advanced_insertion" runat="server" Text="Tel 1 : "></asp:Label> 
                                </td> 
                                <td>      
                                    <asp:TextBox ID="txt_tel1_advanced_insertion" runat="server"></asp:TextBox> 
                                </td> 
                            </tr> 
                            <tr id="tel2"
                                <td> 
                                    <asp:Label ID="lbl_tel2_advanced_insertion" runat="server" Text="Tel 2 : "></asp:Label> 
                                </td> 
                                <td>      
                                    <asp:TextBox ID="txt_tel2_advanced_insertion" runat="server"></asp:TextBox> 
                                </td> 
                            </tr> 
                        </table> 
                    </div> 
</InlineInsertTemplate> 

With the rad scheduler i use methods to insert/update datas :
OnAppointmentInsert="RadScheduler1_AppointmentInsert" 
OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" 
 

In the code behind i want to recup datas from the customize template to insert them in my database i do this :
 protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) 
    { 
        Event monevenement = new Event(); 
         
       Event.InsertEvent(1, "testinsertnom", DateTime.Now, DateTime.Now, "testinsertmotif", TxtNomComplet ... others variables); 
 
    } 

And i can't find a way to get the value of my TxtBox here...

Do you know how could i get this information???

Thanks for helping.





1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 05 Feb 2010, 03:15 PM
Hi julien,

I suggest you use custom attributes.

You should create a field (a new column) in your RadScheduler datasource called TxtNomComplet and set CustomAttributeNames="TxtNomComplet" for RadScheduler. Then define your insert template as follows:

 * * *
<asp:TextBox ID="TxtNomComplet"  runat="server" Text='<%# Bind("TxtNomComplet") %>'></asp:TextBox>
* * *

Then in AppointmentInsert you can access the value entered in the textbox as follows:

e.Appointment.Attributes["TxtNomComplet"]

Let us know if you have further questions.


All the best,
Peter
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Scheduler
Asked by
julien royer
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or