问问
我在这个事件中private void dataGridViewDebug_MouseLeave(object sender, EventArgs e)
触发这个事件private void dataGridViewDebug_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
我用这种方法this.dataGridViewDebug_MouseLeave += new System.EventHandler(this.dataGridViewDebug_CellValueChanged);
为什么出现这种提示: 
“dataGridViewDebug_CellValueChanged”的重载均与委托“SystemEventHandler”不匹配

解决方案 »

  1.   

    直接调用另一个时间不就行了。比如你想在dataGridViewDebug_MouseLeave 事件中调用dataGridViewDebug_CellValidating
    就在dataGridViewDebug_MouseLeave方法中写
    {
        dataGridViewDebug_CellValidating(null, null);
    }
      

  2.   

    private void dataGridViewDebug_MouseLeave(object sender, EventArgs e) 
    {
    dataGridViewDebug_CellValidating(sender, new DataGridViewCellValidatingEventArgs()) ;
    }
      
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 
    http://feiyun0112.cnblogs.com/
      

  3.   


    没错  你只是又添加了CellValidating事件的委托而已  并不会触发  况且你添加了也没用 因为CellValidating事件应该是在设计窗体代码中已经添加了
    你有没写删除这个委托  
    “dataGridViewDebug_CellValueChanged”的重载均与委托“SystemEventHandler”不匹配
    不知道类的方法名的话 C#里有自带说明的吧 直接照着写就可以了
    直接调用见2楼