How to “finalize” a new row

后端 未结 1 713
情歌与酒
情歌与酒 2021-02-15 00:43

So I\'ve been running into some trouble tonight with my c# windows forms application. Is it possible to insert a new row to a datagridview when the currently selected new row is

1条回答
  •  醉梦人生
    2021-02-15 01:22

    Okay so I figured how to make this work. When modifying the values using my custom control, I had to use

    bindingSource.EndEdit();
    dataGridView.NotifyCurrentCellDirty(true);
    dataGridView.EndEdit();
    dataGridView.NotifyCurrentCellDirty(false);
    

    So whenever changes are made to the new row, it forces the row to be committed and adds a new blank row space to the end of the datagridview.

    I did not have to use Validate(), however.

    0 讨论(0)
提交回复
热议问题