<protected void="" gridviewroweventargs="" mode="hold" /> { try { switch (e.Row.RowType) { case DataControlRowType.Header: //... break; case DataControlRowType.DataRow: e.Row.Cells[3].Attributes.Add("onmouseover", "showImage()"); e.Row.Cells[3].Attributes.Add("onmouseout", "hideImage()"); HyperLink lnkbtn = new HyperLink(); lnkbtn.Text = "view"; e.Row.Cells[3].Controls.Add(lnkbtn); //e.Row.Cells[3].Style lnkbtn.NavigateUrl = @"Credtional\editcustomer.aspx"; e.Row.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(gvCustomers, "Select$" + e.Row.RowIndex.ToString())); break; } } catch (Exception ex) { } }
<script type="text/javascript"> function showImage() { document.getElementById("image").style.display = "inline"; document.getElementById("image").src = 'images/Qtrimage1.png'; } function hideImage() { document.getElementById("image").style.display = "none"; document.getElementById("image").src = 'images/Qtrimage2.png'; } </script> <asp:gridview id="gvCustomers" onrowdatabound="gvCustomers_RowDataBound" AutoGenerateColumns="true" runat="server" onselectedindexchanged="gvCustomers_SelectedIndexChanged"> <img src="images/Qtrimage.png" id="image" alt="" width="30px" height="30px" style="display:none;"/>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)