جربها حلوة
VB
Protected Sub GrvUsers_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GrvUsers.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex Mod 2 = 1 Then
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#F2F2F2'")
Else
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'")
End If
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#CCCCCC'")
End If
End SubC#
protected void GrvUsers_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow) {
if (e.Row.RowIndex % 2 == 1) {
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#F2F2F2'");
}
else {
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'");
}
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#CCCCCC'");
}
}



