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

Adding Click Event To Form Template Edit Form

3 Answers 124 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt Tapia
Top achievements
Rank 1
Matt Tapia asked on 28 Jul 2010, 04:02 PM
I have radgrid using a form template edit form. I have added a button in the Form Template Edit Form, but I can not get the OnClick event of the button to fire. I am binding the data grid dynamically in code on Page_Load (even on PostBack). The button in question is btnUpdateMedicalRecord

<telerik:RadGrid runat="server" ID="rgMedicalRecords"  AllowPaging="true" AllowSorting="true" Skin="WebBlue">
       <ClientSettings>
           <Selecting AllowRowSelect="true" />
       </ClientSettings>
       <MasterTableView AutoGenerateColumns="false" 
           DataKeyNames="MedicalRecordID" >
           <Columns
               <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn>
               <telerik:GridBoundColumn DataField="MedicalRecordID" Visible="false" />
               <telerik:GridBoundColumn DataField="MedicalRecordDispositionTypeID" Visible="false" />                
               <telerik:GridBoundColumn DataField="MedicalRecordDispositionTypeDescription" HeaderText = "Disposition" />  
               <telerik:GridBoundColumn DataField="ReviewInquiryStatusTypeID" Visible="false" />   
               <telerik:GridBoundColumn DataField="ReviewInquiryStatusTypeDescription" HeaderText = "Status" /> 
               <telerik:GridDateTimeColumn DataField="ServiceBeginDate" HeaderText="Begin DOS"  DataFormatString="{0:MM/dd/yyyy}" AllowFiltering="false" />                                
               <telerik:GridDateTimeColumn DataField="ServiceEndDate" HeaderText="End DOS"  DataFormatString="{0:MM/dd/yyyy}" AllowFiltering="false" /> 
           </Columns>
           <EditFormSettings EditFormType="Template">
               <FormTemplate>
                       <asp:Table ID="tblEditControl" runat="server" Width="100%" BorderColor="Black" BorderWidth="1">
                           <asp:TableRow>
                               <asp:TableCell Width="20%" VerticalAlign="Top">
                                       <span class="smallboldtext">Begin DOS:</span>
                                       <telerik:RadDatePicker ID="dteServiceBeginDate" runat="server" Width="100" SelectedDate='<%# Bind( "ServiceBeginDate" ) %>'></telerik:RadDatePicker>                                                                 
                               </asp:TableCell>
                               <asp:TableCell Width="20%" VerticalAlign="Top">
                                       <span class="smallboldtext">End DOS:</span>
                                       <telerik:RadDatePicker ID="dteServiceEndDate" runat="server" Width="100" SelectedDate='<%# Bind( "ServiceEndDate" ) %>'></telerik:RadDatePicker>                                                           
                               </asp:TableCell>
                               <asp:TableCell Width="35%" VerticalAlign="Top">
                                       <span class="smallboldtext">Status:</span>
                                       <telerik:RadComboBox ID="rcbStatus" runat="server" DataSource='<%# loadRcbReviewInquiryStatusTypes() %>'
                                       DataTextField="Description" DataValueField="ReviewInquiryStatusTypeID"
                                       SelectedValue='<%# Bind("ReviewInquiryStatusTypeID") %>' Width="250">
                                       </telerik:RadComboBox>                           
                               </asp:TableCell>
                               <asp:TableCell Width="25%" VerticalAlign="Top" HorizontalAlign="Center">
                                   <asp:Button runat="server" ID="btnUpdateMedicalRecord" Text="Update" Width="150"  OnClick="btnUpdateMedicalRecord_Click"  />
                               </asp:TableCell>
                           </asp:TableRow>
                       </asp:Table>   
               </FormTemplate>                                            
           </EditFormSettings>
       </MasterTableView>                
   </telerik:RadGrid>

3 Answers, 1 is accepted

Sort by
0
Matt Tapia
Top achievements
Rank 1
answered on 28 Jul 2010, 04:30 PM
Also, I don't want to just update records. I need to call another procedure or code event on button click.
0
Shinu
Top achievements
Rank 2
answered on 29 Jul 2010, 07:10 AM
Hello,


Have you tried adding CommandName for the button and executing your code in ItemCommand event of grid?


-Shinu.
0
Matt Tapia
Top achievements
Rank 1
answered on 29 Jul 2010, 05:00 PM
ah! that worked. Thanks!
Tags
Grid
Asked by
Matt Tapia
Top achievements
Rank 1
Answers by
Matt Tapia
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or