DataGridview 獲得當前單元格的行號和列號.
阿新 • • 發佈:2019-02-08
private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
{
iTag = (int)this.Tag;
//if (iTag == 4)
//{
// if (e.ColumnIndex ==3)
// MessageBox.Show("該列為只讀列", "提示資訊", MessageBoxButtons.OK, MessageBoxIcon.Information);
//}
//獲取當前單元格的行號和列號
string rowIndex = e.RowIndex.ToString();
string colIndex = e.ColumnIndex.ToString();
}
{
iTag = (int)this.Tag;
//if (iTag == 4)
//{
// if (e.ColumnIndex ==3)
// MessageBox.Show("該列為只讀列", "提示資訊", MessageBoxButtons.OK, MessageBoxIcon.Information);
//}
//獲取當前單元格的行號和列號
string rowIndex = e.RowIndex.ToString();
string colIndex = e.ColumnIndex.ToString();
}