protected void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == DataControlRowType.DataRow)
{
e.Item.Attributes.Add("onclick", "if(document.oldTr !=null){document.oldTr.runtimeStyle.cssText='';}this.runtimeStyle.cssText='background-color:red';document.oldTr=this;window.showModelessDialog('bb.aspx?id=" + e.Row.Cells[0].Text + "');");
}
}
{
if (e.Item.ItemType == DataControlRowType.DataRow)
{
e.Item.Attributes.Add("onclick", "if(document.oldTr !=null){document.oldTr.runtimeStyle.cssText='';}this.runtimeStyle.cssText='background-color:red';document.oldTr=this;window.showModelessDialog('bb.aspx?id=" + e.Row.Cells[0].Text + "');");
}
}
解决方案 »
- Eval绑定的数据突出显示
- 一个简单js问题!
- 批量生成随机字符用批量生成卡号和密码
- 问个弹出窗口的问题!
- 大家通用查询是怎么做的?散分
- 关于ActiveXObject,大家进来看看.
- 遇到一个问题生成的静太文件html什么都不显示,但看其源代码却是正常里面什么都有!这是什么原因
- 紧急求救.net的Oracle问题,高手进
- 关于Request.QueryString的问题!请求帮助!
- 在asp。net页面中点击按钮后怎样实现播放一段flash动画或执行一个应用程序
- 这样让验证码不区分大小写呢?或者双击输入框得到验证码
- 灾难性故障 (异常来自 HRESULT:0x8000FFFF (E_UNEXPECTED))
下面的代码:e.Item.ItemType , DataControlRowType.DataRow 都是什么意思?
{document.oldTr.runtimeStyle.cssText='';}this.runtimeStyle.cssText='background-color:red';document.oldTr=this;window.showModelessDialog('bb.aspx?id=" + e.Row.Cells[0].Text + "');");
这是html代码? 怎么还有什么css的... 就改变个颜色,需要这么复杂吗?
//反选效果
if(e.Item.ItemIndex>=0)
{
e.Item.Attributes.Add("onmouseover", "curr=this.style.backgroundColor;this.style.backgroundColor='#ffff99'");
e.Item.Attributes.Add("onMouseOut", "this.style.backgroundColor=curr");
}