private void dataGridView_DirveConfig_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
try
{
DataGridView dataGridView = (DataGridView)sender;
if (dataGridView.Columns[e.ColumnIndex].Name == "add")
{
DataGridViewRow dr = new DataGridViewRow();
dr.CreateCells(dataGridView);
//行指定插入行
dataGridView.Rows.Insert(e.RowIndex + 1, dr);
}
else if (dataGridView.Columns[e.ColumnIndex].Name == "delete")
{
dataGridView.Rows.RemoveAt(e.RowIndex);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}