我的问题是:我不想在GridView内启用编辑按钮。而是想实现在单击或双击Gridview的某一行时就让被点击的行进入编辑状态。请问各位高手怎样解决?谢谢!

解决方案 »

  1.   

    protected void gvHrtugtim_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.Pager)
            {
                e.Row.Cells[0].Attributes.Add("style", "display:none");
            }
           
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
               // e.Row.Attributes.Add("onclick", "this.cells[0].childNodes[0].click()");
                for (int i = 0; i < gvHrtugtim.Columns.Count; i++)
                {
                    if ((gvHrtugtim.Columns[i] is CommandField) || (gvHrtugtim.Columns[i] is ButtonField))
                    {
                        continue;
                    }
                    e.Row.Cells[i].Attributes.Add("onclick", "this.parentElement.cells[0].childNodes[0].click()");
                }
                // e.Row.Cells[0].Attributes.Add("style", "display:none");        }    }需要第1列扔一个编辑按钮。
      

  2.   

    感谢fdlm_dark() 帮我觖答!我再试试看.