gridview row select
-
please look in to my problem yesterday i posted my query http://www.codeproject.com/script/comments/forums.asp?forumid=12076&mpp=50&fr=51&select=2330846#xx2330846xx[^]
-
please look in to my problem yesterday i posted my query http://www.codeproject.com/script/comments/forums.asp?forumid=12076&mpp=50&fr=51&select=2330846#xx2330846xx[^]
Hi, go to MyArticles. It can help you.
Thanks, Sun Rays Rate this post if you like answer. My Articles
-
Hi, go to MyArticles. It can help you.
Thanks, Sun Rays Rate this post if you like answer. My Articles
the main problem for me is select a row anyway i have done some thing like this
if (e.Row.RowType == DataControlRowType.DataRow) {string alertBox = "alert(" + e.Row.RowIndex + ")"; //string alertBox = e.Row.RowIndex.ToString(); e.Row.Attributes.Add("Onclick", alertBox);}
and i got the index of the row but i want the id of the row how can i get the id of the row can you please tell me in detail if possible with example regards sunilwise -
the main problem for me is select a row anyway i have done some thing like this
if (e.Row.RowType == DataControlRowType.DataRow) {string alertBox = "alert(" + e.Row.RowIndex + ")"; //string alertBox = e.Row.RowIndex.ToString(); e.Row.Attributes.Add("Onclick", alertBox);}
and i got the index of the row but i want the id of the row how can i get the id of the row can you please tell me in detail if possible with example regards sunilwiseHi, to get SelectedRow you have to Create an event of TestGridView_SelectedIndexChanged. Here in this event you can get selected rowindex as well as any cell's value from selected row.
Thanks, Sun Rays Rate this post if you like answer. My Articles
-
Hi, to get SelectedRow you have to Create an event of TestGridView_SelectedIndexChanged. Here in this event you can get selected rowindex as well as any cell's value from selected row.
Thanks, Sun Rays Rate this post if you like answer. My Articles
thank u ray for u r replies it helped me some what by the way i used javescript function and some code
var gridViewCtlId = '<%=gvAuditErrors.ClientID%>'; var gridViewCtl = null; var curSelRow = null; function getGridViewControl() { if (null == gridViewCtl) { gridViewCtl = document.getElementById(gridViewCtlId); } } function onGridViewRowSelected(rowIdx) { var selRow = getSelectedRow(rowIdx); if (curSelRow != null) { curSelRow.style.backgroundColor = '#ffffff'; } if (null != selRow) { curSelRow = selRow; curSelRow.style.backgroundColor = '#99cccc'; alert(rowIdx); } } function getSelectedRow(rowIdx) { getGridViewControl(); if (null != gridViewCtl) { return gridViewCtl.rows\[rowIdx\]; alert(rowIdx); } return null; }
private Int32 m_iRowIdx; protected void gvAuditErrors_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //string m_iRowIdx; e.Row.Attributes.Add("onclick", "onGridViewRowSelected('" + m_iRowIdx.ToString() + "')"); } m_iRowIdx++; }
http://www.netomatix.com/Development/GridViewRowSelectedStyle.aspx[^][^]