此主题相关图片如下:1.png

出现索引超出范围,然后对应的副本表窗口_table1出现红×,点继续后执行的代码能全部正常执行完毕,代码执行的直接操作Datatable上,不是在副本表"窗口_table1"
而且BeforeShowErrorMessage中捕捉不了错误。
************** 异常文本 **************
System.ArgumentOutOfRangeException: 索引超出范围。必须为非负值并小于集合大小。
参数名: index
在 System.Collections.ArrayList.get_Item(Int32 index)
在 C1.Win.C1FlexGrid.RowCollection.get_Item(Int32 index)
在 C1.Win.C1FlexGrid.C1FlexGrid.DrawRow(PaintEventArgs e, Int32 row)
在 C1.Win.C1FlexGrid.C1FlexGridBase.#adb(PaintEventArgs #tQ)
在 C1.Win.C1FlexGrid.C1FlexGridBase.OnPaint(PaintEventArgs e)
在 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
在 System.Windows.Forms.Control.WmPaint(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
我在Try中,有
If DataTables("表A").Find("单号 = '"& dr &"'") IsNot Nothing Then
DataTables("表A").Find("单号 = '"& dr &"'")("状态") = "打开"
DataTables("表A").Find("单号 = '"& dr &"'")("日期") = Now().Year & "-" & format(Now().Month,"00") & "-" & format(Now().Day,"00") & " " & Format(Now().Hour,"00") & ":" & format(Now().Minute,"00") & ":" & format(Now().Second,"00")
DataTables("表A").Find("单号 = '"& dr &"'")("选择") = False
End If
会不会是这个问题造成的,对副本表的原Datatable表操作的地方就只有这个地方。