ZKX's LAB

css实现gridview行背景色交替 关于GridView 中当前行中变色!苦闷了好久啊!

2020-10-03知识5

关于GridView 中当前行中变色!苦闷了好久啊! 是在GridView的 ItemDataBound 事件里面写哦,实例如下:private void dg_ItemDataBound(object sender,DataGridItemEventArgs e){颜色交替e.Item.Attributes.Add(\"onmouseover\",\"this.style.backgroundColor='seashell'\");if(e.Item.ItemType=ListItemType.Item){e.Item.Attributes.Add(\"onmouseout\",\"this.style.backgroundColor='#ffffff'\");}if(e.Item.ItemType=ListItemType.AlternatingItem){e.Item.Attributes.Add(\"onmouseout\",\"this.style.backgroundColor='seashell'\");}}

css实现gridview行背景色交替 关于GridView 中当前行中变色!苦闷了好久啊!

随机阅读

qrcode
访问手机版