slcands 发表于 2015-7-23 14:15:42

TileView 发生集合已修改;可能无法执行枚举操作

本帖最后由 slcands 于 2015-7-23 14:16 编辑

我把TileView与一个DataTable绑定,在另一个线程中修改DataTable,结果发生错误:发生集合已修改;可能无法执行枚举操作
************** 异常文本 **************
System.InvalidOperationException: 集合已修改;可能无法执行枚举操作。
   在 System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   在 DevExpress.XtraEditors.TileControlPainter.DrawItemImage(TileControlInfoArgs e, TileItemViewInfo itemInfo)
   在 DevExpress.XtraEditors.TileControlPainter.DrawItem(TileControlInfoArgs e, TileItemViewInfo itemInfo)
   在 DevExpress.XtraEditors.TileControlPainter.DrawItems(TileControlInfoArgs e, TileGroupViewInfo groupInfo, Boolean groupDraw)
   在 DevExpress.XtraEditors.TileControlPainter.DrawGroup(TileControlInfoArgs e, TileGroupViewInfo groupInfo, Boolean groupDraw)
   在 DevExpress.XtraEditors.TileControlPainter.DrawGroups(TileControlInfoArgs e)
   在 DevExpress.XtraEditors.TileControlPainter.Draw(TileControlInfoArgs e)
   在 DevExpress.XtraGrid.Views.Tile.Drawing.TileViewPainter.Draw(ViewDrawArgs e)
   在 DevExpress.XtraGrid.Views.Base.BaseView.Draw(GraphicsCache e)
   在 DevExpress.XtraGrid.GridControl.OnPaint(PaintEventArgs e)
   在 DevExpress.Utils.Drawing.ControlPaintHelper.ProcessWMPaint(Message& m)
   在 DevExpress.XtraGrid.GridControl.CheckProcessMsg(Message& m)
   在 DevExpress.XtraGrid.GridControl.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

同样把此DataTable绑定到GridView就不会出现错误,请各位指定下~!


页: [1]
查看完整版本: TileView 发生集合已修改;可能无法执行枚举操作