DataGrid 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
'---------------------------------------------------
' Add the OnMouseOver and onmouseout to the Row of the DataGrid
'---------------------------------------------------
E.item.attributes.add ("onmouseover", "this.style.backgroundcolor= ' Silver '")
E.item.attributes.add ("onmouseout", "this.style.backgroundcolor= ' White '")
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
'---------------------------------------------------
' Add the OnMouseOver and onmouseout method a Cell (Column) of the DataGrid
'---------------------------------------------------
E.item.cells (1). Attributes.Add ("onmouseover", "This.style.backgroundcolor= ' #DDEEFF")
E.item.cells (1). Attributes.Add ("onmouseout", "this.style.backgroundcolor= ' White '")
'---------------------------------------------------
' Change ' The Mouse Cursor of a particular Cell (Column) of the DataGrid
' (or do it for a whole Row of DataGrid:)
'---------------------------------------------------
E.item.cells (3). Style ("cursor") = "Hand"
'---------------------------------------------------
' Add the OnClick Alert MessageBox to a particular Cell (Column) of the DataGrid
'---------------------------------------------------
E.item.cells (3). Attributes.Add ("onclick", "Alert" (' Click at ID: ' & E.item.cells (0). Text & "!");
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service