怎样用messagebox显示dataGridView中第一行第一列的值? MessageBox.Show(dataGridView1.Rows[0].Cells[0].Value as string); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 还是不行!!!!!请问一楼为什么messagebox中没有任何内容显示啊?我用的就是下面的语句。期待达人.....private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { MessageBox.Show(dataGridView1.Rows[0].Cells[0].Value as string); } 另外as string 和我用tostring()方法是一样的效果吗? 谢谢 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { MessageBox.Show(this.dataGridView1.CurrentCell.Value.ToString()); MessageBox.Show(this.dataGridView1.CurrentCell.Value as string); }我的 怎么 都能用 ?是不是 恰好你的 dataGridView1.Rows[0].Cells[0].Value 为 null ?如果 是 null 则 tostring 会出错。 wcf客户端有多个网卡,如何配置? 文件“bin\Debug\PMS.exe”正由另一进程使用 c#中,怎样从正在执行的方法中跳出来 datagridview数据样式 ExecuteReader要求已打开且可用的连接.连接的当前状态为正在连接! 请问怎么样把richtextbox中的scrollbar移动到最下面哦,急~~~~~~~~ 我想模拟win2003的事件查看器.就是照样记录系统的事件,但和windows的日志没有关 如何从已存在的文本文件内容前面添加东西? 好不容易积了20分 马上来问 少了点 没办法 模板列中为什么不能分页? 关于.Resx文件 怎么剪裁图片
请问一楼为什么messagebox中没有任何内容显示啊?我用的就是下面的语句。
期待达人.....
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
MessageBox.Show(dataGridView1.Rows[0].Cells[0].Value as string);
}
{
MessageBox.Show(this.dataGridView1.CurrentCell.Value.ToString());
MessageBox.Show(this.dataGridView1.CurrentCell.Value as string);
}我的 怎么 都能用 ?
是不是 恰好你的 dataGridView1.Rows[0].Cells[0].Value 为 null ?
如果 是 null 则 tostring 会出错。