DotNet · 2022年5月26日

关闭窗体时,DataGridView控件发生了System.IndexOutOfRangeException

关闭窗体时,DataGridView控件发生了System.IndexOutOfRangeException

发生了 System.IndexOutOfRangeException
  HResult=-2146233080
  Message=索引 0 没有值。
  Source=System.Windows.Forms

  StackTrace:
       在 System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
  InnerException: 
发生原因:在FormClosed时,对BindSource的DataSource关联的数据列表对像执行了Clear操作,便引发了相关的内部关联操作。其实对于局部数据列表对像来说,这一步是不需要的

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

电影电视剧午夜不寂寞