pav*_*van 3 c# events datagridview winforms
我写了一个事件来检索在单击的单元格的行的第一个单元格的值CellContentClick的事件datagridview.但是当我点击第三个单元格并且当我点击datagridview的第一个或第二个单元格时没有被抬起时,事件才会被提升.
请帮我.
尝试实现CellClick事件而不是CellContentClick事件
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
DataGridView theGrid = sender as DataGridView;
if(theGrid != null)
{
DataGridViewCell selectedCell = theGrid.SelectedCells[0];
//Do your logic here
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8033 次 |
| 最近记录: |