<asp:templatecolumn HeaderText="修改院系信息">
<headerstyle HorizontalAlign="center" Width="80px" VerticalAlign="middle"></headerstyle>
<itemstyle HorizontalAlign="center"></itemstyle>
<itemtemplate>
<asp:imagebutton CommandName="Edit"  ID="EditButton" ImageUrl="images/icon-pencil.gif" CausesValidation="false"
runat="server" />
<img src="images/spacer.gif" width="3">
<asp:imagebutton CommandName="Delete" ID="DeleteButton" ImageUrl="images/icon-delete.gif" CausesValidation="false"
runat="server" />
</itemtemplate>
<edititemtemplate>
<asp:imagebutton CommandName="Update" ID="UpdateButton" ImageUrl="images/icon-floppy.gif" CausesValidation="True"
runat="server" />
<img src="images/spacer.gif" width="3">
<asp:imagebutton CommandName="Cancel" ID="CancelButton" ImageUrl="images/icon-pencil-x.gif" CausesValidation="false"
runat="server" />
</edititemtemplate>
</asp:templatecolumn>这个上面的EditButton单击之后,根本没有过private void DgDepList_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)这个函数啊?请问这是怎么回事?

解决方案 »

  1.   

    参看
    http://www.syncfusion.com/faq/aspnet/Search/391.aspx
      

  2.   

    #region Web 窗体设计器生成的代码
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.DgDepList.EditCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.DgDepList_EditCommand);
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion