找了很久的改变datagrid底色的代码。本代码是用户鼠标经过的时候改变底色的:
vb.net代码:
If e.Item.ItemType <> ListItemType.Header And e.Item.ItemType <> ListItemType.Footer And e.Item.ItemType <> ListItemType.Separator Then
e.Item.Attributes("onmouseover") = "this.bgColor='#61AAF5';"
e.Item.Attributes("onmouseout") = "this.bgColor='#ffffff';"
End If
c#代码:
if (e.Item.ItemType != ListItemType.Header && e.Item.ItemType != ListItemType.Footer && e.Item.ItemType != ListItemType.Separator)
{
e.Item.Attributes["onmouseover"] = "this.bgColor='#61AAF5';";
e.Item.Attributes["onmouseout"] = "this.bgColor='#ffffff';";
e.Item.Attributes["onclick"] = GetPostBackClientHyperlink(csel, "");
} //if结束
posted on 2005-09-15 11:38
飘叶 阅读(200)
评论(0) 编辑 收藏 所属分类:
网上经典东东