Featured post
c# - Make new row dirty programmatically and insert a new row after it in DataGridView -
i've editable unbounded datagridview. i'm changing value of new row programmatically.
normally, when user types in field of new row, becomes dirty , new row inserted below it.
but in case, when user comes in field of new row, i'm trapping function key , changing cell value programmatically.
mygrid.currentcell.value = "xyz";
and doesn't insert new row below it.
now work around tried on cellvaluechanged event handler.
if (mygrid.newrowindex == e.rowindex) { mygrid.rows.insert(e.rowindex + 1, 1); }
but throws error saying no row can inserted after uncommitted new row.
.
how tell mygrid i've made current row (which new row) dirty , there need of new row after it?
i working on winforms datagridview. in case tried @isid solution, here aid in that, tried
mygrid.notifycurrentcelldirty(true); mygrid.notifycurrentcelldirty(false);
by making current cell dirty in not working, have commit cell also. in next command flagging current cell not dirty, enforce datagridview add dirty row. working in project.
- Get link
- X
- Other Apps
Comments
Post a Comment