Wednesday, December 14, 2005 12:57 PM
This is a little tip that can add some ooo and aaah's to your client's reaction when showing off your web skillz. To make it so that your datagrid rows (in asp.net 1.1 or 2.0) change color on mouse over (and back on mouse out), simply:
Protected Sub DataGrid_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid.ItemCreated
e.Item.Attributes.Add("OnMouseOver", "this.style.backgroundColor = 'lightblue';")
e.Item.Attributes.Add("OnMouseOut", "this.style.backgroundColor = 'red;")
End Sub
D