Public Class WebGridView
Inherits System.Web.UI.WebControls.GridView
Public WithEvents gv As GridView
Public Sub gv_RowDataBound(ByVal s As Object, ByVal e As
GridViewRowEventArgs) Handles gv.RowDataBound
e.Row.Attributes.Add("onclick", "alert('leandro')")
End Sub
public class WebGridView : System.Web.UI.WebControls.GridView
{
protected override void onRowDataBound(GridViewRowEventArgs e)
{
base.OnRowDataBound(e);
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseout",
"this.style.backgroundColor='white'");
e.Row.Attributes.Add("onmouseover",
"this.style.backgroundColor='#D7D8B8'");
e.Row.Attributes.Add("style", "cursor:hand");
}
}
}
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.