Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Then
e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor=
e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor=
End If
End Sub
Sub DataGrid2_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Then
e.Item.Cells(1).Attributes.Add("onmouseover", "this.style.backgroundColor=
e.Item.Cells(1).Attributes.Add("onmouseout", "this.style.backgroundColor=
e.Item.Cells(3).Style("cursor") = "hand"
e.Item.Cells(3).Attributes.Add("onclick", "alert('You click at ID: " & e.Item.Cells(0).Text & "!');")
End If
End Sub
本文地址:http://com.8s8s.com/it/it44415.htm