首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

请问,这句是什么意思

2011-12-19 
请教,这句是什么意思?string str this.dataGridView1[0, e.RowIndex].Value.ToString()[解决办法]取dat

请教,这句是什么意思?
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变量

热点排行