通过form上一个按钮事件,实现delete按键的删除功能,不知怎么做
delete删除datagrid上数据,实际上是将其绑定的数据源中相应数据行的datastate属性改为deleted.

解决方案 »

  1.   

    不就是做一个软键盘嘛,Hook一下系统消息,干些你想干的活就可以了。
      

  2.   

    private void dataGrid1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
    {
    if(e.KeyChar =Keys.Delete )
    {
    //删除当前鼠标指定的记录
    }
    }
      

  3.   

    找到数据源的DataRow,然后调用其的Delete方法既可。