Click here to Skip to main content
15,917,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
grid view is inside update panel and poping up through Modal popup extender its not firing any event on Edit(Update, cancel) Add and Delete
Posted
Comments
Sumit_Kumar_Sinha 14-Mar-13 6:33am    
post asp.net script for question
Meenakshi Moolani 15-Mar-13 1:45am    
Hello Sumit
i have added asp script can you plz review and findout what i am missing
Sandeep Mewara 14-Mar-13 6:35am    
It's difficult to guess for anyone based on what you shared.

For now, all I can say is you have not associated events defined and thus the methods are not invoked.
Meenakshi Moolani 15-Mar-13 1:44am    
Hello Sandeep i have added asp script can you plz review and findout what i am missing

Replace Trigger tag with
XML
<Triggers>
               <asp:PostBackTrigger ControlID ="gvMigrationData" 

and in code behind 
 protected void gvupdatePanel_Load(object sender, EventArgs e)
        {

              // To Bind GridView on updateload 
            }
 
Share this answer
 
this way i have i done but no Response

XML
<asp:Panel ID ="gvPanel" runat ="server"   CssClass="gvpopupbox" BorderStyle="Groove">
                <asp:UpdatePanel ID ="gvupdatePanel" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                <table align="center">
                <tr>
                <td align="right" valign="middle">
                    <asp:ImageButton ID="imgRemoveGv" ImageUrl="~/Image/Close.jpg" runat="server"
                        Height="31px" Width="31px" onclick="imgRemoveGv_Click" />
                </td>
                </tr>

                <tr>
                <td align="center" valign="middle">

                    <asp:GridView ID="gvMigrationData" runat="server" CellPadding="4"
                        ShowFooter ="true"  EnableViewState ="false" DataKeyNames ="id"
                        ForeColor="#333333"  AutoGenerateColumns="False"
                        GridLines="None" onrowcancelingedit="gvMigrationData_RowCancelingEdit"  ShowHeaderWhenEmpty="true"
                        onrowcommand="gvMigrationData_RowCommand"
                        onrowcreated="gvMigrationData_RowCreated"
                        onrowediting="gvMigrationData_RowEditing"
                        onrowupdating="gvMigrationData_RowUpdating"
                        onselectedindexchanging="gvMigrationData_SelectedIndexChanging"
                        onrowdeleting="gvMigrationData_RowDeleting"
                        onselectedindexchanged="gvMigrationData_SelectedIndexChanged">
                        <AlternatingRowStyle BackColor="White" />
                          <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                        <SortedAscendingCellStyle BackColor="#FDF5AC" />
                        <SortedAscendingHeaderStyle BackColor="#4D0000" />
                        <SortedDescendingCellStyle BackColor="#FCF6C0" />
                        <SortedDescendingHeaderStyle BackColor="#820000" />
                        <Columns>
                        <asp:TemplateField HeaderText="ID">
                             <ItemTemplate>
                             <asp:Label ID ="lblpersonMID" Text = '<%# Eval("id") %>' runat="server"></asp:Label>
                             </ItemTemplate>
                             <EditItemTemplate>
                             <asp:Label ID ="lblEditpersonMID" Text = '<%# Eval("id") %>' runat="server"></asp:Label>

                             </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText=" From City">
                             <ItemTemplate>
                             <asp:Label ID ="lblFromCity" Text ='<%# Eval("FromCity") %>' runat="server"></asp:Label>
                             </ItemTemplate>
                             <EditItemTemplate>
                             <asp:Label ID ="EditlblFromCity" Text = '<%# Eval("FromCity") %>' runat="server"></asp:Label>

                             <asp:TextBox ID ="txtupdateFromCity" runat ="server" />

                             </EditItemTemplate>
                             <FooterTemplate>
                             <asp:TextBox ID ="txtNewFromCity" runat ="server" />
                             </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Year Of Out">
                             <ItemTemplate>

                             <asp:Label ID ="lblOutYear" Text ='<%# Eval("OutYear") %>' runat="server"></asp:Label>
                             </ItemTemplate>
                             <EditItemTemplate>
                             <asp:Label ID ="EditlblOutYear" Text = '<%# Eval("OutYear") %>' runat="server"></asp:Label>

                            <asp:DropDownList ID ="ddlupdateOutYear" runat ="server">
                            <asp:ListItem Value ="0" Text ="Select Year"></asp:ListItem>
                            <asp:ListItem Value ="1" Text ="1945"></asp:ListItem>

                            </asp:DropDownList>

                             </EditItemTemplate>
                             <FooterTemplate>
                              <asp:DropDownList ID ="ddlNewYearOfOut" runat ="server">
                              <asp:ListItem Value="0" Text="Select Year"></asp:ListItem>
                              <asp:ListItem Value="1" Text="1945"></asp:ListItem>

                              </asp:DropDownList>
                                                           </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Period">
                             <ItemTemplate>
                             <asp:Label ID ="lblmigrationperiod" Text ='<%# Eval("PeriodOut") %>' runat="server"></asp:Label>
                             </ItemTemplate>
                             <EditItemTemplate>
                             <asp:Label ID ="EditlblPeriodOut" Text = '<%# Eval("PeriodOut") %>' runat="server"></asp:Label>

                             <asp:TextBox ID ="txtupdateMigrationPeriod" runat ="server" />

                             </EditItemTemplate>
                             <FooterTemplate>
                             <asp:TextBox ID ="txtNewPeriodOfOut" runat ="server" />

                             </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="To City">
                             <ItemTemplate>
                             <asp:Label ID ="lblToCity" Text ='<%# Eval("ToCity") %>' runat="server"></asp:Label>
                             </ItemTemplate>
                             <EditItemTemplate>
                             <asp:Label ID ="EditlblToCity" Text = '<%# Eval("ToCity") %>' runat="server"></asp:Label>

                             <asp:TextBox ID ="txtupdateToCity" runat ="server" />

                             </EditItemTemplate>

                             <FooterTemplate>
                             <asp:TextBox ID ="txtNewToCity" runat ="server" />

                             </FooterTemplate>

                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Year of In">
                             <ItemTemplate>
                             <asp:Label ID ="lblYearIn" Text ='<%# Eval("InYear") %>' runat="server"></asp:Label>
                             </ItemTemplate>
                             <EditItemTemplate>
                             <asp:Label ID ="EditlblInYear" Text = '<%# Eval("InYear") %>' runat="server"></asp:Label>

                             <asp:DropDownList ID ="ddlInyear" runat ="server">
                             <asp:ListItem Value ="0" Text ="Select Year"></asp:ListItem>
                             <asp:ListItem Value ="1" Text ="1945"></asp:ListItem>

                             </asp:DropDownList>

                             </EditItemTemplate>
                             <FooterTemplate>

                            <asp:DropDownList ID ="ddlNewYearOfIn" runat ="server">
                              <asp:ListItem Value="0" Text="Select Year"></asp:ListItem>
                              <asp:ListItem Value="1" Text="1945"></asp:ListItem>

                              </asp:DropDownList>
                             </FooterTemplate>

                        </asp:TemplateField>
                        <asp:TemplateField HeaderText ="Edit" ShowHeader="true">
                              <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1_Edit" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit"></asp:LinkButton>
                         </ItemTemplate>
                       <EditItemTemplate>
                       <asp:LinkButton ID="LinkButton1_Update" runat="server" CausesValidation="True" CommandName="Update" Text="Update" ></asp:LinkButton>
                       <asp:LinkButton ID="LinkButton2_Cancel" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                      </EditItemTemplate>

                    <FooterStyle HorizontalAlign ="Right" />
                     <FooterTemplate>
                     <asp:LinkButton ID ="lbtnAddNewRecord"  CommandName="AddMoreMigration" runat ="server" Text ="Add More Migration"></asp:LinkButton>

                     </FooterTemplate>


                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Delete">
                          <ItemTemplate>
                           <asp:LinkButton ID ="lbtnDelete"  Text ="Delete" runat ="server" />
                          </ItemTemplate>

                        </asp:TemplateField>

                        </Columns>
                       <EmptyDataTemplate>
                       <table>
                           <tr>
                             <td>
                              <asp:TextBox ID="txtFirstPeriod" runat ="server"></asp:TextBox>
                             </td>

                             <td>
                              <asp:TextBox ID="txtFirstFromCity" runat ="server"></asp:TextBox>

                            </td>

                             <td>
                              <asp:TextBox ID="txtOutYear" runat ="server"></asp:TextBox>

                            </td>

                             <td>
                              <asp:TextBox ID="txtToCity" runat ="server"></asp:TextBox>

                            </td>

                             <td>
                              <asp:TextBox ID="txtInYear" runat ="server"></asp:TextBox>

                            </td>


                           </tr>
                       </table>
                       </EmptyDataTemplate>
                    </asp:GridView>


                </td>
                </tr>
                <tr>
                 <td>
                     <asp:Button ID="btnMigrationDetails" runat="server" CssClass="label"
                         onclick="btnMigrationDetails_Click" Text="Save" />
                 </td>
                </tr>
                </table>


                </ContentTemplate>
                <Triggers>
                <asp:AsyncPostBackTrigger  ControlID= "gvMigrationData" EventName="RowEditing"  />
                <asp:AsyncPostBackTrigger  ControlID= "gvMigrationData" EventName="RowCreated" />
                <asp:AsyncPostBackTrigger  ControlID= "gvMigrationData" EventName="RowUpdating" />
                <asp:AsyncPostBackTrigger  ControlID= "gvMigrationData" EventName="RowCancelingEdit" />
                <asp:AsyncPostBackTrigger  ControlID= "gvMigrationData" EventName="RowCommand" />
                <asp:AsyncPostBackTrigger  ControlID= "gvMigrationData" EventName="RowDeleting" />

                </Triggers>




                </asp:UpdatePanel>


               </asp:Panel>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900