GridView 行单击或双击事件绑定

        protected void gvTeacherTaskList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "ShowDetail")
            { 
            
            }
        }

        protected void gvTeacherTaskList_DataBound(object sender, EventArgs e)
        {
            foreach (GridViewRow row in gvTeacherTaskList.Rows)
            {
                var btnShowDetail = row.FindControl("btnShowDetail") as Button;
                row.Attributes.Add("ondblclick", ClientScript.GetPostBackEventReference(btnShowDetail, null));
            }
        }

 

posted on 2016-12-15 11:49  空明流光  阅读(2925)  评论(0编辑  收藏  举报

导航