标题:[原创]asp.net 2.0控件新特性
只看楼主
beniao
Rank: 2
等 级:新手上路
威 望:4
帖 子:367
专家分:2
注 册:2004-12-17
 问题点数:0 回复次数:3 
[原创]asp.net 2.0控件新特性

vs.net 2005里的GridView控件(类似2003里的DataGrid控件)
在控件上双击某一行,弹出一个新窗口显示该行的具体内容,代码如下:
在GridView的RowDataBound事件里编码
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add ("onmouseover","this.Style.backgroundColor='#FFFFCC';this.style.color='buttontext';this.style.cursor='default';");
//e.Row.Attributes.Add("onmouseout","this.Style.backgroundColor=";this.Style.color=";");

e.Row.Attributes.Add("ondblclick", "window.open('Default.aspx?id=" + e.Row.Cells[0].Text + "')");
}

搜索更多相关主题的帖子: asp 特性 控件 
2007-05-06 02:22
beniao
Rank: 2
等 级:新手上路
威 望:4
帖 子:367
专家分:2
注 册:2004-12-17
得分:0 
都没有人顶下.

博客:http://
2007-05-11 20:17
刘小芳
Rank: 2
等 级:新手上路
威 望:4
帖 子:137
专家分:0
注 册:2006-10-17
得分:0 

效果图发来看看吗,哥哥


2007-05-11 20:53
beniao
Rank: 2
等 级:新手上路
威 望:4
帖 子:367
专家分:2
注 册:2004-12-17
得分:0 

关键就这一行代码.你加在事件里去试下就知道.
e.Row.Attributes.Add("ondblclick", "window.open('Default.aspx?id=" + e.Row.Cells[0].Text + "')");


博客:http://
2007-05-11 23:10



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-137155-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.305240 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved