私は以下のようなテーブルを持っています
これらは私がやろうとしているコードですが、希望はありませんが、そのCAid014
値を取得したい
string splitter = dataGridView1.Rows[dataGridView1.RowCount].Cells[0].ToString();
MessageBox.Show(splitter); // to print what splitter got
datagridview1.rowcountを使用しているので、datagridview1.rowsが最後の行を取得します。そしてcells[0]は行の0インデックスを取得し、エラーが発生します。
CAid
そのセルを取得するにはどうすればよいですか?
解決しました:私はこのような値が恋しいです
string splitter = dataGridView1.Rows[dataGridView1.RowCount].Cells[0].value.ToString();