gridview -script ?
-
var gridViewCtlId = '<%=gridview1.ClientID%>'; var gridViewCtl = null; var curSelRow = null; var curRowIdx = -1; function getGridViewControl() { if (null == gridViewCtl) { gridViewCtl = document.getElementById(gridViewCtlId); } } function onGridViewRowSelected(rowIdx) { var selRow = getSelectedRow(rowIdx); if (null != selRow) { curSelRow = selRow; var cellValue = getCellValue(rowIdx, 0); alert(cellValue); } } function getSelectedRow(rowIdx) { return getGridRow(rowIdx); } function getGridRow(rowIdx) { getGridViewControl(); if (null != gridViewCtl) { return gridViewCtl.rows[rowIdx]; } return null; } function getGridColumn(rowIdx, colIdx) { var gridRow = getGridRow(rowIdx); if (null != gridRow) { return gridRow.cells[colIdx]; } return null; } function getCellValue(rowIdx, colIdx) { var gridCell = getGridColumn(rowIdx, colIdx); if (null != gridCell) { alert(gridViewCtlId) return gridCell.innerText; } return null; } If i call it as: For Each row As GridViewRow In GridView1.Rows CType(row.FindControl("Textbox1"), TextBox).Attributes("onclick") = "javascript: return getCellValue("+row.rowindex.toString()+",1)" It shows the heading of 2nd column only if i click on first row. 2nd row onwards it does not show any value. <div class="ForumSig">sanjay kumar samantaray</div></x-turndown>