点击某一模板列,该模板所在的行变色,怎么实现?
解决方案 »
- 一组图片按钮的图片切换效果怎样实现?
- 请教:: self.location.href="www.baidu.com" 页面跳转后URL变成http:://localhost/MyWeb/www.baidu.com 为何?
- qq在线聊天的代码在那里找呢??有官方的地址么
- 那位大哥,大姐能帮帮小弟,非常感谢!
- 命名空间问题
- “/Material”应用程序中的服务器错误。
- if(是高手){ASPNET的英文版网站怎么做?}
- 急急!!!数据库中的时间为2005-1-1为什么绑定到datagrid变成怎么解决这个问题?!!!!!!!
- 在线等,变量得问题??
- iso文件怎样才可以安装?
- ■■■■ 请教关于三楼站长的OA程序问题
- 人民币大写函数修正!
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
string strcal_Name = (string)DataBinder.Eval(e.Item.DataItem, "Duty");
ImageButton del = (ImageButton)e.Item.FindControl("del");
del.Attributes.Add("onclick",String.Format("return confirm('确信要删除该条信息?')",strcal_Name.Trim()));
if (e.Item.Cells[2].Text.ToLower() != " " && e.Item.Cells[2].Text != "")
{
e.Item.Cells[2].Text = publicFunction.getUserName(e.Item.Cells[2].Text,Session);
} ListItemType itemType = e.Item.ItemType;
e.Item.Attributes["onmouseover"] = "javascript:this.style.backgroundColor='red';cursor='hand';" ;
if (itemType == ListItemType.Item )
{
e.Item.Attributes["onmouseout"] = "javascript:this.style.backgroundColor='WhiteSmoke';";
}
else if( itemType == ListItemType.AlternatingItem)
{
e.Item.Attributes["onmouseout"] = "javascript:this.style.backgroundColor='WhiteSmoke';";
}
}
这里包含着一个完整的ItemDataBound时间,首先要判断从第2行开始,然后用javasript实现鼠标点到那那就变色,然后在设置单行和双行的颜色变回去。那么颜色也可以用英语写 比如whitesmoke red等等
问对人了你,我刚研究过这个问题。
行,列,全部,根据自己需要改