how to know when mouse is clicked on gridview's column header.
-
how to perform an action against the mouse click on the header of the c#asp.net gridview's column.
Simpler work around for this is var vTh = document.getElementsByTagName("th"); for(var i=0;i<vTh.length;i++) { vTh[i].onclick=yourmethod; } But make sure that your html doesn't contain anyother THs, if so add your own logic to restrict it inside the for loop.
-
Simpler work around for this is var vTh = document.getElementsByTagName("th"); for(var i=0;i<vTh.length;i++) { vTh[i].onclick=yourmethod; } But make sure that your html doesn't contain anyother THs, if so add your own logic to restrict it inside the for loop.
-
in row databound event you will have to write something like.. if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onclick", "javascript:ChangeRowColor('" + e.Row.ClientID + "')"); } and changecolorfunction in javascript with what ever you want to do....
umerumerumer
-
Gridview column headers are nothing but THs in the html generated. In the body load you have to put that code which will loop through the list of Ths in the document and associate onclick event for all of them.
-
This code needs to be registered on page load. TableObject.rows[0].onclick = Function("return YourFunctionName(this);"); Here TableObject is ur gridview object rows[0] gives the first row that is the header row. Then write ur logic in "YourFunctionName" Regards Santhosh N