Description:
1. The datagridview(name is "grid") has three columns(ps: ID, FuelLeftKg, Model) and is databound of objects datasource.
2. When enter the newly row(ps: row head has both Arrow and * icons), will set the default values
private void grid_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
{
e.Row.Cells[1].Value = 0;
e.Row.Cells[2].Value = "AirBus 350";
}
3. when enter the newly row's last cell(Model) via [TAB], I hope the other newly row will append to the datagridview last.
private void grid_CellEnter(object sender, DataGridViewCellEventArgs e)
{
if (grid.NewRowIndex == e.RowIndex && e.ColumnIndex == 2)
{
grid.CurrentRow.DataGridView.EndEdit();
grid.EndEdit();
CurrencyManager cm = (CurrencyManager)grid.BindingContext[grid.DataSource];
cm.EndCurrentEdit();
}
}
Qustion:
The newly row only set defualt value and move by [TAB] without any KEYIN. When enter the newly row last cell, there is
NO THE OTHER NEW ROW APPEND after the original newly row? Pls, help. Thanks!