日期:2014-05-18  浏览次数:20742 次

请教,这句是什么意思?
string str = this.dataGridView1[0, e.RowIndex].Value.ToString();

------解决方案--------------------
取dataGridView单元格的值!
------解决方案--------------------
取dataGridView1中某行某列的值
------解决方案--------------------
获得dataGridView1 cell值的字符串
------解决方案--------------------
string str = this.dataGridView1[0, e.RowIndex].Value.ToString();
取第1列,事件触发行,对应单元格的字符串值

但是上面可能会出错,在不能保证
this.dataGridView1[0, e.RowIndex].Value
为null的前提下,不能用ToString();
------解决方案--------------------
探讨
string str = this.dataGridView1[0, e.RowIndex].Value.ToString();
取第1列,事件触发行,对应单元格的字符串值

但是上面可能会出错,在不能保证
this.dataGridView1[0, e.RowIndex].Value
为null的前提下,不能用ToString();

------解决方案--------------------
获得dataGridView1 cell值的字符串
------解决方案--------------------
你run下不会看结果?
------解决方案--------------------
string str = this.dataGridView1[e.RowIndex][0].ToString();
------解决方案--------------------
探讨
string str = this.dataGridView1[0, e.RowIndex].Value.ToString();
取第1列,事件触发行,对应单元格的字符串值

但是上面可能会出错,在不能保证
this.dataGridView1[0, e.RowIndex].Value
为null的前提下,不能用ToString();

------解决方案--------------------


`` string str = this.dataGridView1[0, e.RowIndex].Value.ToString();

` 取出dataGridView1中第1行中列索引为e.RowIndex的数值 ``

`` 然后转换为字符串```

``
------解决方案--------------------
取当前DataGridVIew所选行的第一个单元格的值,以字符串形式传给str变量