0

我有gridview,我需要从其类后面的代码中触发内联编辑。如何实现 ClientScriptManager.RegisterForEventValidation。

<asp:GridView ID="gridViewTest" runat="server" 
        Height="145px" Width="369px" onrowdatabound="gv_RowDataBound" OnRowEditing="gv_RowEditing">
    </asp:GridView>

   protected void gv_RowEditing(object sender, GridViewEditEventArgs e)
    {
        gridViewTest.EditIndex = e.NewEditIndex;
    }
4

1 回答 1

0

以下是上述问题的解决方案:

     protected override void Render(HtmlTextWriter writer)
    {
        for (int i = 0; i < gridViewTest.Rows.Count; i++)
            ClientScript.RegisterForEventValidation(gridViewTest.UniqueID, "Edit$" + i);
        base.Render(writer);
    }
于 2013-09-09T13:54:36.180 回答