Sunday, October 7, 2018

Display Gridview Cell Value on Button click event

 <asp:TemplateField HeaderText="Assign Reviewer" ItemStyle-CssClass="hs1" ItemStyle-

   Width="20px">

               <ItemTemplate> 


                   <asp:ImageButton ID="lnk_Update" runat="server"   CommandName="Select"

                    ImageUrl="../images/editicon.png"  OnClick="lnk_Update_Click" />

   </ItemTemplate>
   </asp:TemplateField>



C#  Code

  protected void lnk_Update_Click(object sender, EventArgs e)

    {

         var closeLink = (Control)sender;

        GridViewRow row = (GridViewRow)closeLink.NamingContainer;


        Label5.Text  = row.Cells[5].Text; // here we are


}

No comments:

Post a Comment

GRIDVIEW ON ROW DATA BOUND EVENT

 Database Create  Student : roll , name , city , cost  Fix 6 Value  in Database Record  ====================================================...