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 still on its default values? Or, if I want to change the values programmatically, how can I emulate the user editing the textbox in order to finalize the row?
To clarify, when a row is a new row (and shows up as true with the isNewRow
property), I cannot figure out how to change out of the isNewRow = true
state to generate a new empty row below.
I've tried dataGridView.EndEdit()
, dataGridView.CurrentRow.DataGridView.EndEdit()
, bindingSource.EndEdit()
, and none of these have really done the trick. (also, using dataGridView.BeginEdit()
puts the text box into editmode
, which isn't handy, because I can't seem to edit the cell programmatically after that)
Ideally, I would like to be able to continue to hit enter on new rows, while changing their values with a custom control, or not, and have a new row appear underneath.
Does anyone have any solutions to this?