GridView的双击等几个事件
2010-07-06 18:25
155 查看
[align=left]【前台】[/align]
[align=left]<script language="javascript">
function dbclickevent(d)
{
window.alert("事件类型: doubleclidk 作用对象: " + d);
}
function clickevent(d)
{
window.alert("事件类型: onclick 作用对象: " + d);
}
function gridviewitemkeydownevent(d)
{
window.alert("事件类型: gridviewitemkeydownevent 作用对象: " + d);
}
function keydownevent()
{
if( event.altkey && event.keycode > 48 && event.keycode < 54 )
{
window.alert("事件类型: formkeydownevent 选中记录数: " + ( parseint(event.keycode) - 48 ));
}
}
</script>[/align]
[align=left] [/align]
[align=left]【后台】[/align]
[align=left]if( e.row.rowtype == datacontrolrowtype.datarow)
{
//鼠标移动到每项时颜色交替效果
e.row.attributes.add("onmouseout", "this.style.backgroundcolor=white;this.style.color=#003399");
e.row.attributes.add("onmouseover", "this.style.backgroundcolor=#6699ff;this.style.color=#8c4510");
//单击/双击 事件
e.row.attributes.add("ondblclick", "dbclickevent(" + e.row.cells[1].text + ")");
e.row.attributes.add("onclick", "clickevent(" + e.row.cells[1].text + ")");
e.row.attributes.add("onkeydown", "gridviewitemkeydownevent(" + e.row.cells[1].text + ")");
//设置悬浮鼠标指针形状为"小手"
e.row.attributes["style"] = "cursor:hand";
}[/align]
[align=left]<script language="javascript">
function dbclickevent(d)
{
window.alert("事件类型: doubleclidk 作用对象: " + d);
}
function clickevent(d)
{
window.alert("事件类型: onclick 作用对象: " + d);
}
function gridviewitemkeydownevent(d)
{
window.alert("事件类型: gridviewitemkeydownevent 作用对象: " + d);
}
function keydownevent()
{
if( event.altkey && event.keycode > 48 && event.keycode < 54 )
{
window.alert("事件类型: formkeydownevent 选中记录数: " + ( parseint(event.keycode) - 48 ));
}
}
</script>[/align]
[align=left] [/align]
[align=left]【后台】[/align]
[align=left]if( e.row.rowtype == datacontrolrowtype.datarow)
{
//鼠标移动到每项时颜色交替效果
e.row.attributes.add("onmouseout", "this.style.backgroundcolor=white;this.style.color=#003399");
e.row.attributes.add("onmouseover", "this.style.backgroundcolor=#6699ff;this.style.color=#8c4510");
//单击/双击 事件
e.row.attributes.add("ondblclick", "dbclickevent(" + e.row.cells[1].text + ")");
e.row.attributes.add("onclick", "clickevent(" + e.row.cells[1].text + ")");
e.row.attributes.add("onkeydown", "gridviewitemkeydownevent(" + e.row.cells[1].text + ")");
//设置悬浮鼠标指针形状为"小手"
e.row.attributes["style"] = "cursor:hand";
}[/align]
相关文章推荐
- DEV-aspxgridview行客户端单击双击事件RowClick、RowDblClick 、
- ASP.NET DEMO 15: 同时支持行单击和双击事件的 GridView/DataGrid
- 扩展GridView控件(6) - 响应行的单击事件和双击事件
- ASP.NET DEMO 15: 同时支持行单击和双击事件的 GridView/DataGrid
- GridView的自定义列,及几个常用事件
- Dev的Gridview控件,实现 每一行行的双击的事件
- DEV gridview 捕获行双击事件
- Asp.net 2.0 GridView的几个事件(如实现: 行的双击/单击/捕捉键盘按键/鼠标悬浮/移出效果)(示例代码下载)
- Asp.net 2.0 GridView的几个事件(如实现: 行的双击/单击/捕捉键盘按键/鼠标悬浮/移出效果)(示例代码下载)
- Asp.net 2.0 GridView的几个事件(如实现: 行的双击/单击/捕捉键盘按键/鼠标悬浮/移出效果)(转)
- gridview填加双击事件
- 扩展GridView实现多选(全选)、点击行任意位置选择行、选中变色、添加双击事件等
- 关于ASPXGridview的双击事件弹出 【转】
- c# dev gridview 行双击事件
- 如何自己添加后台事件(Gridview双击事件)
- ASP.NET DEMO 15: 同时支持行单击和双击事件的 GridView/DataGrid
- dev gridview控件双击事件
- 给自定义的gridview添加双击事件
- DEV gridview 捕获行双击事件
- gridview的几个事件