Gridview鼠标选定颜色和具体列颜色
来源:互联网 发布:java web微信支付demo 编辑:程序博客网 时间:2024/05/19 21:41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover","c=this.style.backgroundColor;this.style.backgroundColor='red';");
e.Row.Attributes.Add("onmouseout","this.style.backgroundColor=c");
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
for (int i = 0; i <= GridView1.Rows.Count; i++)
{
string lbl = Convert.ToString(DataBinder.Eval(e.Row.DataItem,"state"));
if (lbl == "CA")
{
e.Row.BackColor = System.Drawing.Color.Blue;
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover","c=this.style.backgroundColor;this.style.backgroundColor='red';");
e.Row.Attributes.Add("onmouseout","this.style.backgroundColor=c");
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
for (int i = 0; i <= GridView1.Rows.Count; i++)
{
string lbl = Convert.ToString(DataBinder.Eval(e.Row.DataItem,"state"));
if (lbl == "CA")
{
e.Row.BackColor = System.Drawing.Color.Blue;
}
}
}
}
- Gridview鼠标选定颜色和具体列颜色
- gridview 鼠标经过改变颜色
- Gridview 和 DataList 鼠标经过时行颜色变换
- gridview中鼠标都改变颜色
- GridView中鼠标滑过行颜色
- DevExpress GridView列标题自定义背景颜色
- GridView中动态交换列和JS控制选择CheckBox行变颜色
- 在DataGrid中,使鼠标到达的行和列显示不同的颜色
- 在DataGrid中,使鼠标到达的行和列显示不同的颜色 (转载)
- 在DataGrid中,使鼠标到达的行和列显示不同的颜色
- DataGrid鼠标到达的行和列显示不同的颜色
- 在DataGrid中,使鼠标到达的行和列显示不同的颜色
- DataGrid鼠标到达的行和列显示不同的颜色
- GridView鼠标移动到某一行时行发生变色和为Gridview中编辑模板中的控件添加颜色
- Gridview控件在鼠标经过时颜色交替变化
- 鼠标经过GridView的行改变行颜色
- 鼠标停留在GridView某一行时颜色改变
- 鼠标停留在GridView某一行时颜色改变
- 全屏窗口javascript
- datalist用法整合
- datareader读数据存列表中
- vs2008与vs2005的冲突
- FileUpload上传控件1
- Gridview鼠标选定颜色和具体列颜色
- FRAMESET 元素 | frameSet 对象
- Gridview自定义分页
- win2000/xp/2003下完全卸载ORACLE
- C# 开机启动
- image控件写成流的形式存SQL
- MyEclipse_6.0.1GA_E3.3常用简介
- JSP 实现文件上传
- listbox基本用法