Thursday, April 28, 2011

Double Click event for a Row in a Grid View

1. First while on OnRowDataBound Method of your GridView insert the following:



if (e.Row.RowType == DataControlRowType.DataRow)
{
for (int i = 0; i < (e.Row.Cells.Count); i++)
{
e.Row.Attributes.Add("ondblclick""Javascript:rowDblClick();");
}
}
2. Write a javascript method in your aspx page.

  function rowDblClick(){ 
        alert("done!");
      }
 Thats it you are done !

0 comments:

Post a Comment

 

2011 ·Code-Studio by yrus.