Foxtable(狐表)用户栏目专家坐堂 → 索引超出范围问题请教


  共有2736人关注过本帖平板打印复制链接

主题:索引超出范围问题请教

帅哥哟,离线,有人找我吗?
z769036165
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:758 积分:5408 威望:0 精华:0 注册:2012/10/5 21:53:00
索引超出范围问题请教  发帖心情 Post By:2019/9/12 11:42:00 [只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下: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表操作的地方就只有这个地方。

 回到顶部