如何点击数据 让其显示在下方的textbox中 datagridview 中的数据通过鼠标单击 如何显示在textbox中 请各位大虾指点 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { textBox1.Text =dataGridView1.Rows[dataGridView1.CurrentRow.Index ].Cells["id"].Value.ToString() ; textBox2.Text = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["name"].Value.ToString(); } DataGridView的CellClick事件中设置textbox的Text即可。例如:private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e){ textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();} Dictionary泛型如何做参数使用 C#获取外网IP【不用其他网站】 资源分怎么得?本来一件方便人得事变得这么麻烦 NHibernate 一个NHibernate.Cfg.Configuration 映射多个Assembly 求去百度html一正则表达式 代码生成器 c#树控件互相赋值,如何实现? 提供几个深圳网友自助游 WPF,如何使FontSize不向下传递? 委托、事件和回调函数这3者之间到底是什么关系? 把数据导入到word模板中,求代码 有没有比较方便的语法检查一个字符串是否在某个字符串数组中?
{
textBox1.Text =dataGridView1.Rows[dataGridView1.CurrentRow.Index ].Cells["id"].Value.ToString() ;
textBox2.Text = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["name"].Value.ToString();
}
例如:
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
}