• The GridView 'gv ' fired event RowEditing which wasn 't handled.


         很久没写gridview的事件代码了,刚写了个rowcommand的事件,出现下面的错误:

    The   GridView   'gv '   fired   event   RowEditing   which   wasn 't   handled.  
    Description:   An   unhandled   exception   occurred   during   the   execution   of   the   current   web   request.   Please   review   the   stack   trace   for   more   information   about   the   error   and   where   it   originated   in   the   code.  

    Exception   Details:   System.Web.HttpException:   The   GridView   'gv '   fired   event   RowEditing   which   wasn 't   handled.

    Source   Error:  

    An   unhandled   exception   was   generated   during   the   execution   of   the   current   web   request.   Information   regarding   the   origin   and   location   of   the   exception   can   be   identified   using   the   exception   stack   trace   below.    

    查找原因,发现要加入以下事件RowEditing :

    .aspx:
    <asp:GridView   ID= "GridView1 "   runat= "server "   OnRowEditing= "Editing ">
       <Columns>
         <asp:CommandField   ShowEditButton= "true "   />
       </Columns>
    </asp:GridView>

    .cs:
    protected   void   Editing(object   sender,   GridViewEditEventArgs   e)
    {
      GridView1.EditIndex   =   e.NewEditIndex;

    }

    其他事件,如:Delete,Cancel,Update也是相似的。

    编程技巧也跟工具一样,久久不用,就会生锈。记之~~~

  • 相关阅读:
    Codeforces Round #636 (Div. 3)
    HTTP请求方法
    HDU2993
    《算法竞赛进阶指南》 #0x61 图论
    Codeforces Round #634 (Div. 3)
    Codeforces Round #633 (Div. 2)
    pandas 数据类型转换及描述统计
    pandas 数据库数据的读取
    pandas电子表格的读取(pandas中的read_excel)
    pandas外部数据的读取构造数据框-文本文件读取(一种utf-8中文编码乱码处理经验)
  • 原文地址:https://www.cnblogs.com/huige1004/p/1371633.html
Copyright © 2020-2023  润新知