VS05基于桌面的dataGridView 点击弹出对话框

liyj19870228 2008-12-12 08:50:48
我要做的一个功能是
dataGridView1填充一个数据
然后启动显示的时候
用户双击或者右键具体点击哪条数据的时候 弹出对应的对话框,而这个对话框中有对应的主键值
我该怎么做呢?

不知道大家听懂了没 在线等的,因为这个问题比较重要,先麻烦大家了 谢谢
...全文
110 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
liyj19870228 2008-12-12
  • 打赏
  • 举报
回复
先谢谢大家的帮助 我先试试
常熟老九 2008-12-12
  • 打赏
  • 举报
回复
private void dataGridView1_DoubleClick(object sender, System.EventArgs e)
{
int intCurrentRowNumber = this.dataGridView1.CurrentCell.RowIndex;
string strn= this.dataGridView1.Rows[intCurrentRowNumber].Cells[0].Value.ToString().Trim();
MessageBox.Show(strn);
}
wuyq11 2008-12-12
  • 打赏
  • 举报
回复
private void dataGridView1_DoubleClick(object sender, System.EventArgs e)
{
int intCurrentRowNumber = this.dataGridView1.CurrentCell.RowIndex;
string strn= this.dataGridView1.Rows[intCurrentRowNumber].Cells[0].Value.ToString().Trim();
MessageBox.Show(strn);
}
clleady 2008-12-12
  • 打赏
  • 举报
回复
职业经理人 2008-12-12
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 sonickevin 的回复:]
C# code
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
MessageBox.Show(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
}
[/Quote]


哈哈哈哈,支持楼上的,这个我经常用的,呵呵呵
sonickevin 2008-12-12
  • 打赏
  • 举报
回复

private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
MessageBox.Show(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
}

111,131

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧