DataGrid点击更新后,不执行程序,该如何解决?

解决方案 »

  1.   

    事件丢了吧?还是说UpdateCommand事件里没写东西?,,
      

  2.   

    手动再指定下咯
    貌似这是03的BUG
    我是经常遇到这个郁闷的问题
      

  3.   

    把事件都删了。然后重新生成事件,最后在UpdateCommand事件里写上更新的内容就行了。最后现重新绑定一下。
      

  4.   

    最简单的解决方法:
    找出后台代码中关于此更新命令的方法,如dgData_UpdateCommand,在前台DataGrid的属性里设置UpdateCommand时,将此方法名dgData_UpdateCommand复制到其后的属性框里,重新运行下程序即可.
      

  5.   

    确认前台事件填写无误后,在updateCommand方法设断点调试,检验是否执行到此方法.
    1)如执行到,检查程序的完整性和正确性.
    2)程序无错,但没有执行到,重做此更新,把原来所写代码复制过来..
    就不信不行了..不行的话,最好把你的程序也发出来看下
      

  6.   

    /*事件定义*/
    private void InitializeComponent()
    {    
    this.Button1.Click += new System.EventHandler(this.Button1_Click);
    this.DataGrid1.CancelCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_CancelCommand);
    this.DataGrid1.EditCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_EditCommand);
    this.DataGrid1.UpdateCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_UpdateCommand);
    this.DataGrid1.DeleteCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_DeleteCommand);
    this.Load += new System.EventHandler(this.Page_Load); }
    /*更新事件代码,输出zzzz看是否运行,答案让人失望*/
    private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
    {
    Response.Write("zzzz");
    }
      

  7.   

    感觉还是前后台调用事件不对应的问题,把方法删除了,在前台重新双击updateCommand进入后台编辑代码...实在想不出解决办法,为了省时间,重做也算是一种解决办法吧