清风的blog 优然探索

DataGird行的鼠标放上变色

 Public Function DataRowColorChange(ByRef e As System.Web.UI.WebControls.DataGridItemEventArgs)
        If e.Item.ItemIndex < 0 Then
        Else
            If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
                e.Item.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#EEEEEE'")
                e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor")
            End If
        End If
    End Function

2008年9月11日 | 发布:admin | 分类:技术笔记 | 评论:0

发表留言: