更新时间:2023-12-04 11:27:10
如果您只想删除选定的行,则需要使用SelectedRows属性:
If you want to delete just the selected rows, then you need to use the SelectedRows property:
foreach (DataGridViewRow row in myDataGridView.SelectedRows)
{
myDataGridView.Rows.Remove(row);
}