标签: c# mysql events datagridview nullpointerexception
我正在使用DataGridView从MySQL数据库中检索数据。在DataSource设置之前,CellEnter和RowEnter会触发。但是因为当时仍然没有行,所以我对单元格/行的引用为空。该程序崩溃为NullPointerException。如何抑制初始CellEnter事件,但在加载数据后让它继续监听?
DataGridView
DataSource
CellEnter
RowEnter
NullPointerException