ERROLIREERS
New Member
Currently, when a user clicks on anywhere on a row, it selects that row. Unfortunately, when in edit mode (after clicking on "edit'), the form does a postback every time a user clicks anywhere on the form. How do I disable this and let the user edit the row in peace?This is what I have that enables click to select row:\[code\]protected void GridView1_RowCreated(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { List<int> notClickable = new List<int>(); { notClickable.Add(0); } for (int i = 0; i < e.Row.Cells.Count; i++) { if (!notClickable.Contains(i)) { e.Row.Cells.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(this.GridView1, "Select$" + e.Row.RowIndex); e.Row.Cells.Attributes["onclick"] = this.Page.ClientScript.GetPostBackClientHyperlink(this.GridView1, "Select$" + e.Row.RowIndex); } } e.Row.Attributes.Add("onmouseover", "this.originalstyle=this.style.backgroundColor;this.style.backgroundColor='#ceedfc'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalstyle"); e.Row.Attributes.Add("style", "cursorointer;"); e.Row.ToolTip = "Click to select row"; } }\[/code\]