我需要datagridview
使用cellClick_event
.
我试过这样:
private void DataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
{
var lastIndex = DataGridView.SelectedRows[DataGridView.SelectedRows.Count - 1].Index;
var currentIndex = DataGridView.CurrentRow.Index;
if (currentIndex != lastIndex)
{
//code
}
else
{
}
}
但它不起作用。我收到错误:
index out of bound
- 如何获取
cell's
datagridview 的最后编辑的行索引cellClick_event
? datagridview.cellclick
除了解决它还有其他事件吗?