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

[Solved] Problems with InlineInsertTemplate custom submit button

3 Answers 149 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 15 May 2009, 04:05 PM
Hi

I am having trouble figuring out what function is called when i click my custom submit button within the InlineInsertTemplate.
I think its RadScheduler1_AppointmentInsert but if that is so how can i tell what type of button was clicked ie insert or cancel?(I have given them commandnames) I also cannot see how i gain access to the values with any of the custom fields i have added within this template as

RadScheduler1_AppointmentInsert(

object sender, SchedulerCancelEventArgs e)

 

doesnt seem to allow me access anythjing othere than the apppointment information.
 <Telerik:RadPane runat="Server" ID="leftPane" Scrolling="None">   
                <div style="padding:10px 0px 10px 10px;">  
                    <Telerik:RadScheduler Culture="en-GB" runat="server" ID="RadScheduler1" Skin="Office2007" EnableEmbeddedSkins="True" 
                        ShowFooter="true"  DayStartTime="08:00:00" DayEndTime="21:00:00" 
                        TimeZoneOffset="00:00:00" OverflowBehavior="Expand" SelectedView="MonthView" Height="100%" 
                        TimelineView-UserSelectable="false" OnNavigationComplete="RadScheduler1_NavigationComplete" 
                        OnAppointmentDelete="RadScheduler1_AppointmentDelete" 
                        OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnAppointmentInsert="RadScheduler1_AppointmentInsert" 
                        FirstDayOfWeek="Monday" LastDayOfWeek="Friday" CustomAttributeNames="customTitle" OnClientAppointmentEditing="OnClientAppointmentEditing"    
                        OnClientAppointmentMoveStart="OnClientAppointmentMoveStart" ShowAllDayRow="true" OnFormCreated="RadScheduler1_FormCreated" 
                        MinimumInlineFormWidth="300" MinimumInlineFormHeight="150">  
                        <AppointmentTemplate> 
                            <asp:Label ID="lblTitle" runat="server"><%# Eval("customTitle") %></asp:Label>   
                        </AppointmentTemplate>   
                        <InlineInsertTemplate> 
                           <div id="InlineInsertTemplate">  
                           <table width="100%">  
                            <tr>                                  
                                <td align="right">Note</td>                             
                                <td> 
                                    <asp:TextBox ID="txtboxNote" runat="server" TextMode="MultiLine" Width="100%" Height="50px"></asp:TextBox> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td align="right">Appointment Type</td> 
                                <td> 
                                    <asp:DropDownList ID="ddlCalendarTypes" runat="server"></asp:DropDownList> 
                                </td> 
                            </tr> 
                            <tr> 
                            <td colspan="2" align="right">  
                                <table> 
                                    <tr> 
                                        <td> 
                                           <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert" > 
                                               <asp:Image runat="server" ID="imgInsert" ImageUrl="Images/ok.gif" AlternateText="insert" /> 
                                           </asp:LinkButton> 
                                        </td> 
                                        <td>&nbsp</td>                         
                                        <td> 
                                            <asp:LinkButton ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel">  
                                                <asp:Image runat="server" ID="imgCancel" ImageUrl="Images/cancel.gif" AlternateText="cancel" /> 
                                            </asp:LinkButton> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                            </tr> 
                           </table> 
                                  
                           </div> 
                        </InlineInsertTemplate>   
                                                 
                    </Telerik:RadScheduler>                  
                    </div>             
                </Telerik:RadPane>               

Thanks



3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 18 May 2009, 07:50 AM
Hello Greg,

When you click the "Cancel" button, no event is fired,  because the insert is canceled.
Clicking  "Insert" fires OnAppointmentInsert event. In the InlineInsertTemplate you should bind the used controls to the properties of the appointment as shown here and in the OnAppointmentInsert event handler you can get a reference to the inserted appointment like this:

<td> 
   <asp:TextBox ID="txtboxNote" runat="server" TextMode="MultiLine" Width="100%" Height="50px" Text='<%# Bind("Subject") %>'></asp:TextBox> 
</td> 

and the handler:

protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)  
{  
    String subject = e.Appointment.Subject;  


Greetings,
Yana
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
Andrew
Top achievements
Rank 1
answered on 18 May 2009, 09:12 AM
Hi

How would this work for a drop down box? as i assume that the bind allows the collection of the text in the codebehind, so how would i go about getting the selected value of a drop down box? Does it work in a similair way as custom attributes?

Thanks
0
Yana
Telerik team
answered on 20 May 2009, 01:58 PM
Hello Greg,

The DropDownList couldn't be binded direclty, so I suggest you use a HiddenField binded to a custom attribute which can store the selected index of the dropdown. Please find attached a simple page demonstrating this approach.

Best wishes,
Yana
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.
Tags
Scheduler
Asked by
Andrew
Top achievements
Rank 1
Answers by
Yana
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or