您当前的位置: 首页 >  .net

ASP.NET中DataGrid鼠标经过感知以及点击行弹出窗口

发布时间:2004-10-22 13:02:00 ,浏览量:0

 选择自 xujh 的 Blog    作者Blog:http://blog.csdn.net/xujh/

很多人说很难,其实就这几行代码。只要在DataGrid1的ItemDataBound中写入下代码即可

private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) {         if(e.Item.ItemIndex>=0)  //此行可以删除掉       {                 //弹出窗口代码  e.Item.Attributes.Add("onclick","window.open('WebForm2.aspx?ZoneNo="+e.Item.Cells[0].Text+"','','Toolbar=no')");  e.Item.Attributes.Add("onMouseOver","this.style.backgroundColor='#e9e9e9'; this.style.cursor='hand';");  e.Item.Attributes.Add("onMouseOut","this.style.backgroundColor='#f7f7f7';");         } }

关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    109273博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.1015s