我在datagridview中有些数据,设想是这样:选中其中任意一个单元格,能立刻把该单元格所在行号显示出来。我写的程序如下:
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
int RowNum = dataGridView1.CurrentCell.RowIndex;
textBox1.Text += " " + RowNum;
}
在调试运行的时候发现有的单元格能返回,有的单元格点击之后没有反应,这是怎么一回事?
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
int RowNum = dataGridView1.CurrentCell.RowIndex;
textBox1.Text += " " + RowNum;
}
在调试运行的时候发现有的单元格能返回,有的单元格点击之后没有反应,这是怎么一回事?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货