c# - How to create a gridview row clickable? -
i want create gridview row whole row clickable , when click anywhere on row open aspx page rows information.
i using asp.net , c#. can me please. in advance.
just call below code on rowdatabound
click anywhere on gridview row fire selectedindexchanged
event
you have <%@ page enableeventvalidation="false" %>
protected void grdyourgrid_rowdatabound(object sender, gridviewroweventargs e) { if (e.row.rowtype == datacontrolrowtype.datarow) { // attaching 1 onclick event entire row, // fire selectedindexchanged, while click anywhere on row. e.row.attributes["onclick"] = clientscript.getpostbackclienthyperlink(this.grdyourgrid, "select$" + e.row.rowindex); } }
Comments
Post a Comment