背景色:GridView中的行的背景色根据条件来显示不同的颜色来源: 发布时间:星期三, 2008年9月10日 浏览:60次 评论:0
//以下代码必须写在GridView中的ItemDataBound事件中
if (e.Item.Cells[6].Text =="红色" { //当评分种类为不满意时背景色为红色 e.Item.Cells[6].Attributes.Add("style", "background-color:#FF9999"); } else if (e.Item.Cells[6].Text == "绿色" { //当评分种类为没有评时背景色为绿色 //在此调用Color方法时必须引用命名空间using System.Drawing; e.Item.BackColor = Color.Green; } //让Button背景色半透明的方法 btnSlect.BackColor = Color.Transparent; //使用Color必须引用命名空间using System.Drawing; 0
相关文章
读者评论
发表评论 |