MSDN上讲解说在RowCreated事件中加入 
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            // Retrieve the LinkButton control from the first column.
            LinkButton LinkButton1 = (LinkButton)e.Row.FindControl("LinkButton1");
            // Set the LinkButton's CommandArgument property with the row's index.
            LinkButton1.CommandArgument = e.Row.RowIndex.ToString();
        }
就不会出现“未将对象应用添加到对象的引用错误”,但是我加上了还是有错误。
希望高手能具体讲解一下怎么用GridView的RowCommand添加编辑行的处理。