答案 0 :(得分:1)
你可以这样做
private void datagridview1_SelectionChanged(object sender, EventArgs e)
{
if (datagridview1.SelectedCells.Count > 0)
{
foreach (DataGridViewCell cell in dataGridView1.SelectedCells)
{
int selectedrowindex = cell.RowIndex;
DataGridViewRow selectedRow = datagridview1.Rows[selectedrowindex];
string a = Convert.ToString(selectedRow.Cells[0].Value);
}
}
}