这是在C#/winform中
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
int rowindex = e.RowIndex;
int colIndex = e.ColumnIndex;
if (colIndex != 0)
{
if (dataGridView1[colIndex - 1, rowindex].Value == null || dataGridView1[colIndex - 1, rowindex].Value.ToString() == "")
{
MessageBox.Show("前一个单元格不能为空");
}
}
}
查看源文件他是