c# - To update a row in grid view -


I want to update a line in the grid view below. I tried but I could not do it. Please help me to do this

  & lt; ASP:. GridView width = "100%" runat = "server" id = "srchgrid" AutoGenerateColumns = "false" CellPadding = "4" ForeColor = "# 333333" ShowFooter = "false" PageSize-mode = "NumericPages" PageSize = "10" PagerStyle Vision = "true" AllowPaging = "true" AllowSorting = "true" OnRowCommand = "srchgrid_RowCommand" RowUpdating = "srchgrid_RowUpdating" CssClass = "MGRID" Pager Style-CSS Class = "PGR" AlternatingRO Style-CSS Class = "Alt" Gt; & Lt; Asp: TemplateField HeaderText = "Edit" item style-width = "150px" & gt; & Lt; ItemTemplate & gt; & Lt; ASP: LinkButton id = "btnEdit" runat = "server" RowIndex = "edit" text = "edit" CausesValidation = "false" /> & Lt; / ItemTemplate & gt; Protected Zero srchgrid_RowUpdating (Object Sender, GridViewUpdateEventArgs e) {if (e.RowIndex.Equals ("Edit")) {LinkButton btnView =   

(LinkButton) srchgrid.Rows [e.RowIndex] .FindControl ("btnView"); }}

add cells [ Cell_No ]

  LinkButton btnView = (LinkButton) srchgrid.Rows [e.RowIndex] .ells [Cell_No] .FindControl ("btnView");  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -