codice:
Protected Sub dgutenti_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
If e.Item.ItemType = ListItemType.Item Then
e.Item.Attributes.Add("onMouseOver", "javascript:this.style.backgroundColor='#ffcc00';")
e.Item.Attributes.Add("onMouseOut", "javascript:this.style.backgroundColor='#ffffff';")
End If
If e.Item.ItemType = ListItemType.AlternatingItem Then
e.Item.Attributes.Add("onMouseOver", "javascript:this.style.backgroundColor='#ffcc00';")
e.Item.Attributes.Add("onMouseOut", "javascript:this.style.backgroundColor='#bbe3ff';")
End If
If e.Item.ItemType = ListItemType.EditItem Then
If e.Item.ItemIndex Mod 2 = 0 Then
e.Item.Attributes.Add("onMouseOver", "javascript:this.style.backgroundColor='#ffcc00';")
e.Item.Attributes.Add("onMouseOut", "javascript:this.style.backgroundColor='#ffffff';")
Else
e.Item.Attributes.Add("onMouseOver", "javascript:this.style.backgroundColor='#ffcc00';")
e.Item.Attributes.Add("onMouseOut", "javascript:this.style.backgroundColor='#bbe3ff';")
End If
End Sub
ho risolto così.