Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8470801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:37:17+00:00 2026-06-10T16:37:17+00:00

I have a gridview and i have two buttons edit and delete.Once i click

  • 0

I have a gridview and i have two buttons edit and delete.Once i click on edit button, i take the values and put those in textboxes outside grid and visible update and cancel button. but that does not fires..

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
          <ContentTemplate>
                <asp:Panel ID="pnladdproduct" runat="server">
                           <div class="mws-form-col-1-8">
                                <asp:Label ID="Label11" runat="server" AssociatedControlID="btnAddProduct">&nbsp;</asp:Label>
                                <div class="mws-form-item large">
                                     <asp:Button ID="btnAddProduct" ValidationGroup="grpProduct" runat="server" CssClass="mws-button red" Text="Add" OnClick="btnAddProduct_Click" />
                                </div>
                           </div>
                </asp:Panel>
                <asp:Panel ID="pnlUpdateProduct" runat="server">
                           <div class="mws-form-col-1-8">
                                <asp:Label ID="Label12" runat="server" AssociatedControlID="btnUpdateProduct">&nbsp;</asp:Label>
                                <div class="mws-form-item large">
                                     <asp:Button ID="btnUpdateProduct" runat="server" CausesValidation="False" CssClass="mws-button blue" Text="Update" OnClick="btnUpdateProduct_Click" />
                                </div>
                          </div>
                </asp:Panel>
                <asp:Panel ID="pnlCancel" runat="server">
                           <div class="mws-form-col-1-8">
                                <asp:Label ID="Label13" runat="server" AssociatedControlID="btnCancelUpdate">&nbsp;</asp:Label>
                                <div class="mws-form-item large">
                                     <asp:Button ID="btnCancelUpdate" CausesValidation="False" runat="server" CssClass="mws-button gray" Text="Cancel" OnClick="btnCancelUpdate_Click" />
                                 </div>
                            </div>
                 </asp:Panel>
                 <div class="mws-form-col-8-8">
                      <asp:GridView ID="grdProduct" ShowHeaderWhenEmpty="True" CssClass="mGrid" runat="server" AutoGenerateColumns="False" AllowPaging="True" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" OnPageIndexChanging="grdProduct_PageIndexChanging" OnRowDeleting="grdProduct_RowDeleting" OnRowEditing="grdProduct_RowEditing">
                                    <Columns>
                                             <asp:BoundField DataField="Name" HeaderText="Product" SortExpression="Product" />
                                             <asp:BoundField DataField="Quantity" HeaderText="Quantity" SortExpression="Quantity" />
                                             <asp:BoundField DataField="Rate" HeaderText="Rate" SortExpression="Rate" />
                                             <asp:BoundField DataField="Amount" HeaderText="Amount" SortExpression="Amount" />
                                             <asp:ButtonField ButtonType="Image" CommandName="Edit" HeaderText="Edit" ImageUrl="~/css/icons/16/edit.png" ShowHeader="True" Text="Edit" />
                                             <asp:ButtonField ButtonType="Image" CommandName="Delete" HeaderText="Delete" ImageUrl="~/css/icons/16/delete.png" ShowHeader="True" Text="Delete" />
                                             <asp:TemplateField HeaderText="HiddenColumn">
                                                  <HeaderTemplate>
                                                  </HeaderTemplate>
                                                  <ItemTemplate>
                                                               <asp:HiddenField ID="hdfProductID" runat="server" Value='<%# Bind("ProID") %>' />
                                                  </ItemTemplate>
                                             </asp:TemplateField>
                                    </Columns>
                                              <EmptyDataTemplate>
                                                    No Products Added !!
                                              </EmptyDataTemplate>
                      </asp:GridView>
                      <div class="mws-form-row inline">
                           <asp:Label ID="Label15" runat="server" AssociatedControlID="txtQuantity">Total Amount</asp:Label>
                           <div class="mws-form-item medium">
                                <asp:TextBox ID="txtTotalAmount" BackColor="Beige" BorderColor="red" ReadOnly="True" CssClass="mws-textinput" runat="server"></asp:TextBox>
                           </div>
                      </div>
                 </div>
          </ContentTemplate>
          <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnUpdateProduct"  EventName="Click"/>
                    <asp:PostBackTrigger ControlID="btnCancelUpdate" />                                        
          </Triggers>
</asp:UpdatePanel>

Server side Code..

 protected void grdProduct_RowEditing(object sender, GridViewEditEventArgs e)
    {

        Session["proID"] = StepGetHiddenValuesFromGridControl(e.NewEditIndex);
        txtQuantity.Text = grdProduct.Rows[e.NewEditIndex].Cells[1].Text;
        txtRate.Text = grdProduct.Rows[e.NewEditIndex].Cells[2].Text;
        txtAmount.Text = grdProduct.Rows[e.NewEditIndex].Cells[3].Text;
        txtQuantity.BackColor = Color.Beige;
        txtRate.BackColor = Color.Beige;
        txtAmount.BackColor = Color.Beige;
        //pnladdproduct.Visible = false;
        //pnlUpdateProduct.Visible = true;
        //pnlCancel.Visible = true;
   }

protected void btnUpdateProduct_Click(object sender, EventArgs e)
    {
        // this code not firing
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:37:18+00:00Added an answer on June 10, 2026 at 4:37 pm

    I don’t think there’s a need for triggers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a gridview,two buttons(edit,save) ,what i wanna to do is : when click
I have a editable gridview. When I click on edit button corresponding to a
I have a Gridview I have Click Button and two labels. (Risk_label and MV_label)
I have a gridview in wpf and have a two radio buttons and a
I have created two buttons in a gridview. I wish to achieve the following
I have dropdown list on my page. When I click on submit button, gridview
I have two Gridview in my Web application.I need ,while clicking the (ExcelExpot) button
I have a GridView control whose first two columns have buttons. When the row
I have a gridview that displays items details, I added two template fields one
I have two cascading dropdowns and one gridview control. on page load iam binding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.