在DataGrid中怎么样把鼠标放到某一行,那行就焦点显示? 在DataGrid中怎么样把鼠标放到某一行,那行就焦点显示?并可以选中。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 参考 private void dataGrid_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if ( ( e.Item.ItemType == ListItemType.Item ) || ( e.Item.ItemType == ListItemType.AlternatingItem ) || ( e.Item.ItemType == ListItemType.SelectedItem ) ) { e.Item.Attributes.Add( "OnMouseOver", "this.style.backgroundColor = '#BED3E9';this.style.cursor='hand'"); e.Item.Attributes.Add( "OnMouseOut", "this.style.backgroundColor='white';"); } } griddatabind中写if(e.Item.ItemIndex >= 0){e.Item.Attributes["onmouseover"] = "this.name=this.style.backgroundColor;this.style.backgroundColor='#cccccc'";e.Item.Attributes["onmouseout"] = "this.style.backgroundColor=this.name;";} 大家都来给点意见 asp.net事务 在asp.net中输出VML矢量图的问题(在线等) 菜鸟请教:求一段JS的代码,请指点一下!! 如何启动集成windows身份验证 Asp.net(c#)查询XML文档的结果怎么显示在Panel里? 有日期运算的SQL语句怎么写啊?高手们帮帮忙啦 关于asp。net forums安装后无法浏览,报错,求救 asp.net学多久可以到外面去捞钱 ? 一个insert 问题,马上给分 DataGrid中的模板列CheckBox获焦点的问题 Page.FindControl的问题?
{
if ( ( e.Item.ItemType == ListItemType.Item ) || ( e.Item.ItemType == ListItemType.AlternatingItem ) || ( e.Item.ItemType == ListItemType.SelectedItem ) )
{
e.Item.Attributes.Add( "OnMouseOver", "this.style.backgroundColor = '#BED3E9';this.style.cursor='hand'");
e.Item.Attributes.Add( "OnMouseOut", "this.style.backgroundColor='white';");
}
}
if(e.Item.ItemIndex >= 0)
{
e.Item.Attributes["onmouseover"] = "this.name=this.style.backgroundColor;this.style.backgroundColor='#cccccc'";
e.Item.Attributes["onmouseout"] = "this.style.backgroundColor=this.name;";
}