或有其他替代方法?
解决方案 »
- owa 问题,高手请进 在线等回复
- AppSettings["ACCESSCONNECTIONSTRING"].ToString();{"未将对象引用设置到对象的实例。"}
- 一个弹出对话框问题。。。高分求救
- 散分,发布一个生成CODE39条形码的代码
- 求屏幕捕捉工具
- dataGrid中
- 请各位高手帮帮忙 Visual Studio .NET 2003 开发突发问题,谢谢
- 类似于../1085379,21831938.aspx是怎样实现的
- 用showModalDialog打开的模式窗口中的标题栏能去掉吗?怎么去?如果不能去,怎么改标题?
- Web部署时几个文件的含义
- 取递归查询出的值(在线等!)
- 请问关于ajax安全性的问题
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#C1D2EE'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'"); }
{
if (e.Row.RowIndex > -1)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor = 'lightyellow';");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor = 'white';");
}
}
在datagrid的属性中选择事件,双击ItemDataBound事件,在.cs中:
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item||e.Item.ItemType == ListItemType.AlternatingItem)
{
e.Item.Attributes.Add("onmouseover","c=this.style.backgroundColor;this.style.backgroundColor = '#ddeeff'");
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor = c;");
}
{
//加入鼠标滑过的高亮效果
if (e.Row.RowType == DataControlRowType.DataRow)//判定当前的行是否属于datarow类型的行
{
//当鼠标放上去的时候
e.Row.Attributes["OnMouseOver"]="TableRow_OnMouseOver(this)";
e.Row.Attributes["OnMouseOut"] ="TableRow_OnMouseOut(this)";
} }