The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
var curSelRowIndex = -1; var curSelRow = null; function GridDblClick(varRowIndex) { debugger; if (curSelRow != null) { curSelRow.style.backgroundColor = (curSelRowIndex % 2 == 0 ? "#EBEBEB" : "activeborder"); } document.getElementById("<%=GridView1.ClientID %>").rows[varRowIndex].style.backgroundColor = '#ffc0cb'; curSelRow = document.getElementById("<%=GridView1.ClientID %>").rows[varRowIndex]; curSelRowIndex = varRowIndex; document.getElementById('<%=hidMID.ClientID %>').value = 'E~' + GetInnerText(document.getElementById("<%=GridView1.ClientID %>").rows[varRowIndex].cells[1]) + '~' + GetInnerText(document.getElementById("<%=GridView1.ClientID %>").rows[varRowIndex].cells[2]) + '~' + GetInnerText(document.getElementById("<%=GridView1.ClientID %>").rows[varRowIndex].cells[3]) + '~' + GetInnerText(document.getElementById("<%=GridView1.ClientID %>").rows[varRowIndex].cells[4]) + '~' + GetInnerText(document.getElementById("<%=GridView1.ClientID %>").rows[varRowIndex].cells[5]) + '~' + GetInnerText(document.getElementById("<%=GridView1.ClientID %>").rows[varRowIndex].cells[6]) + '~' + GetInnerText(document.getElementById("<%=GridView1.ClientID %>").rows[varRowIndex].cells[7]) + '~' + GetInnerText(document.getElementById("<%=GridView1.ClientID %>").rows[varRowIndex].cells[8]); }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex > -1) { e.Row.Attributes.Add("ondblclick", "javascript:return GridDblClick(" + (e.Row.RowIndex + 1) + ")"); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)