DotNet · 2022年5月26日

DataGridView控件出现异常:操作无效,原因是它导致对 SetCurrentCellAddressCore 函数的可重入调用

DataGridView控件出现异常:操作无效,原因是它导致对 SetCurrentCellAddressCore 函数的可重入调用

原因和解决方案:

在绑定模式下,设置了DataSource为nothing
xBindingSource.DataSource = MyHub.mConfig.mUserTaskConfig.mUserTaskList   ‘mUserTaskList为nothing
发生了 System.InvalidOperationException
  HResult=-2146233079
  Message=操作无效,原因是它导致对 SetCurrentCellAddressCore 函数的可重入调用。
  Source=System.Windows.Forms
  StackTrace:
       在 System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick)
  InnerException: 

最新电影,电视剧,尽在午夜剧场

电影电视剧午夜不寂寞