You are not logged in.
This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.
Pages: 1
Topic closed
private void Button_Click(object sender, RoutedEventArgs e)
{
var grid = windowsFormsHost.Child as unvell.ReoGrid.ReoGridControl;
var sheet = grid.CurrentWorksheet;
sheet.Dispose();
运行后的出错信息如下:
未处理System.ArgumentOutOfRangeException
HResult=-2146233086
Message=索引超出范围。必须为非负值并小于集合大小。
参数名: index
Source=mscorlib
ParamName=index
StackTrace:
在 System.Collections.Generic.List`1.get_Item(Int32 index)
在 unvell.ReoGrid.Worksheet.GetRangePhysicsBounds(RangePosition range)
在 bj.OnMouseMove(Point location, MouseButtons buttons)
在 eb.OnMouseMove(Point location, MouseButtons buttons)
在 unvell.ReoGrid.ReoGridControl.b(PointF A_0, MouseButtons A_1)
在 unvell.ReoGrid.ReoGridControl.OnMouseMove(MouseEventArgs e)
在 System.Windows.Forms.Control.WmMouseMove(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 unvell.ReoGrid.ReoGridControl.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
在 System.Windows.Application.RunInternal(Window window)
在 System.Windows.Application.Run()
在 WpfApplication2.App.Main() 位置 i:\ReoGrid-1.1.0-All-Packages\WpfApplication1\WpfApplication2\obj\Debug\App.g.cs:行号 0
在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
Last edited by maibo (2016-02-27 07:39:47)
Offline
设置为 CurrentWorksheet 的 Worksheet 不能被 Dispose,现在的版本没有检查这个条件。
另外被追加到 Workbook 里的 Worksheet 也不能 Dispose,下个版本将加入检查条件。
只有被创建出来还未加入 Workbook 的 Worksheet 和已经从 Workbook 中移除的 Worksheet 可以被 Dispose。
如果想重置 CurrentWorksheet,可以使用 Reset 方法。
var sheet = grid.CurrentWorksheet;
sheet.Reset();
Offline
明白,谢谢。
Offline
Pages: 1
Topic closed