[导入]GridView 双击选择行

http://www.cnblogs.com/EasyData/archive/2007/10/15/924947.html

"Select$"表示进入行的选择状态,也可将其改为"Update$"、"Edit$"等其他事件。
protected override void Render(HtmlTextWriter writer)
    {
        
foreach (GridViewRow Row in GridView1.Rows)
        {
            
if (Row.RowType == DataControlRowType.DataRow)
            {
                Row.Attributes[
"ondblclick"= ClientScript.GetPostBackEventReference(GridView1, "Select$" + Row.RowIndex.ToString(), true);
                Row.Attributes[
"style"= "cursor:pointer";
                Row.Attributes[
"title"= "双击选择行";
            }
        }
        
base.Render(writer);
    }

文章来源:http://wengjinbao.cn/?tid=480
posted @ 2007-10-18 09:59  海浪~~  阅读(404)  评论(1编辑  收藏  举报