Select newly added Row - DataGridView and BindingSource

前端 未结 5 1649
眼角桃花
眼角桃花 2020-12-11 08:01

I\'m adding a new Row to a BindingSource that is Bound to a DataGridView

source.AddNew();

After this, use BindingSource to get the newly ad

5条回答
  •  眼角桃花
    2020-12-11 08:54

    Dont know id its the best solution but for instance looks better than iterate.

            DataRowView drv = (DataRowView)source.AddNew();
            grupoTableAdapter.Update(drv.Row);
            grupoBindingSource.Position = grupoBindingSource.Find("ID", drv.Row.ItemArray[0]);
    

提交回复
热议问题