Make new row dirty programmatically and insert a new row after it in DataGridView

前端 未结 4 432
没有蜡笔的小新
没有蜡笔的小新 2021-01-18 04:37

I\'ve an editable unbounded datagridview. I\'m changing the value of new row programmatically.

Normally, when user types in any field of a new row, it becomes dirty

4条回答
  •  自闭症患者
    2021-01-18 05:05

    I am working on winforms DataGridView. In my case i tried @iSid solution, but here is an aid in that, i tried this

    myGrid.NotifyCurrentCellDirty(true);
    myGrid.NotifyCurrentCellDirty(false);
    

    By only making current cell dirty in not working, you have to commit that cell also. In the next command i am flagging the current cell is not dirty, this will enforce datagridview to add a dirty row. It is working in my project.

提交回复
热议问题