📌  相关文章
📜  删除 Datagridview 中的选定单元格 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:49.434000             🧑  作者: Mango

代码示例1
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.Delete)
    {
        foreach (DataGridViewCell cell in dataGridView1.SelectedCells)
        {
            cell.Value = "";
        }
        e.Handled = true;
    }
}