Winform DataGridView点击事件问题 当点击DataGridView网格中的数据时,弹出该行的详细信息!请各位写出详细代码!!谢谢!!(asp.net会,Winform不会!!讲理论的别发!!谢谢) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { label1.Text = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["学号"].Value.ToString(); label2.Text = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["姓名"].Value.ToString(); label3.Text = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["性别"].Value.ToString(); } 2楼,按照你的方法好象不行!!报错!Form2 ff = new Form2(); ff.Txt = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["stime"].Value.ToString(); ff.ShowDialog();明明dataGridView1上绑定了stime,而现在报Stime没这个列名!! private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { label1.Text = dataGridView1.Rows[e.RowIndex].Cells["学号"].Value.ToString(); label2.Text = dataGridView1.Rows[e.RowIndex].Cells["姓名"].Value.ToString(); label3.Text = dataGridView1.Rows[e.RowIndex].Cells["性别"].Value.ToString(); } 晕~上面的e.RowIndex实际就是 e.RowIndex ,我其实是想设为红色字体的 如何将C#写的WCF客户端程序封装成dll给C++调用? 商用程序应具备一些什么样的特点? 使用System.Collections.DictionaryBase派生类时遇到的问题 关于Calendar控件精确度问题 关于 Parent的问题 请问在有DotNetBar的界面上如何响应DotNetBar上TreeView中Node的点击事件? 求助,如何调用一个API函数? NPOI 复制表如何操作 小妹急求客户端自动更新的断点续传叔叔们求帮助啦!! gsop返回超时处理问题。 循环下标 C#如何调用C++ DLL分配的内存
{
label1.Text = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["学号"].Value.ToString();
label2.Text = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["姓名"].Value.ToString();
label3.Text = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["性别"].Value.ToString();
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
label1.Text = dataGridView1.Rows[e.RowIndex].Cells["学号"].Value.ToString();
label2.Text = dataGridView1.Rows[e.RowIndex].Cells["姓名"].Value.ToString();
label3.Text = dataGridView1.Rows[e.RowIndex].Cells["性别"].Value.ToString();
}