鼠标移动,改变DataGrid颜色
发布日期:2021-06-30 19:00:51
浏览次数:2
分类:技术文章
本文共 1666 字,大约阅读时间需要 5 分钟。
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 method to the Row of 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 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 DataGrid ' (Or you may 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 DataGrid '--------------------------------------------------- e.Item.Cells(3).Attributes.Add("onclick", "alert('You click at ID: " & e.Item.Cells(0).Text & "!');") End If End Sub转载地址:https://linuxstyle.blog.csdn.net/article/details/149755 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
路过按个爪印,很不错,赞一个!
[***.219.124.196]2024年05月02日 02时49分25秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
位图索引Bitmap indexes
2019-04-30
YOLO算法(二)—— Yolov2 & yolo9000
2019-04-30
YOLO算法(三)—— Yolov3 & Yolo系列网络优缺点
2019-04-30
Python的__future__模块
2019-04-30
计算机视觉中的cost-volume的概念具体指什么(代价体积)
2019-04-30
启发函数heuristic 与 A*
2019-04-30
Image Pyramid(图像金字塔)
2019-04-30
Oracle 作业记录
2019-04-30
putty连接AWS配置(multimedia project)
2019-04-30
Hourglass Network 沙漏网络 (pose estimation姿态估计)
2019-04-30
OpenCV实战(二)——答题卡识别判卷
2019-04-30
目标检测神经网络的发展历程(52 个目标检测模型)
2019-04-30
Boundary loss 损失函数
2019-04-30
tensorflow使用tensorboard进行可视化
2019-04-30
凸优化 convex optimization
2019-04-30