Need Help: Hiding rows cause index error?

Posted by: liangwenfeng on 8 September 2017, 2:10 pm EST

  • Posted 8 September 2017, 2:10 pm EST

    <P> Today i update my spread control from "3.0.2008.2005" to "3.0.2010.2005", some code just crush:(</P>
    <P>example code(i have a 5 rows, 5 columns spread table):</P>
    <P>            fpSpread1.ActiveSheet.Rows[0].Visible = false;<BR>            fpSpread1.ActiveSheet.Rows[1].Visible = false;<BR>            fpSpread1.ActiveSheet.Rows[2].Visible = false;<BR>            fpSpread1.ActiveSheet.Rows[3].Visible = false;<BR>            fpSpread1.ActiveSheet.Rows[4].Visible = false;</P>
    <P>            fpSpread1.ActiveSheet.SetValue(0, 0, "ok");</P>
    <P>while setValue() was called,  "3.0.2010.2005" throw an exception:</P>
    <P>System.IndexOutOfRangeException ??????????????<BR>  Message="Invalid row index: -1 (must be between 0 and 4)"<BR>  Source="FarPoint.Win.SpreadJ"<BR>  StackTrace:<BR>       ?? FarPoint.Win.Spread.Cells.get_Item(Int32 row, Int32 column)<BR>       ?? FarPoint.Win.Spread.SheetView.ah()<BR>       ?? FarPoint.Win.Spread.SheetView.OnCellChanged(Int32 row, Int32 column, Int32 rowCount, Int32 columnCount)<BR>       ?? FarPoint.Win.Spread.SheetView.OnDataModelChanged(Object sender, SheetDataModelEventArgs e)<BR>       ?? FarPoint.Win.Spread.Model.SheetDataModelEventHandler.Invoke(Object sender, SheetDataModelEventArgs e)<BR>       ?? FarPoint.Win.Spread.Model.BaseSheetDataModel.OnChanged(SheetDataModelEventArgs e)<BR>       ?? FarPoint.Win.Spread.Model.BaseSheetDataModel.FireChanged(Int32 row, Int32 column)<BR>       ?? FarPoint.Win.Spread.Model.DefaultSheetDataModel.SetValue(Int32 row, Int32 column, Object value)<BR>       ?? FarPoint.Win.Spread.SheetView.SetValue(Int32 row, Int32 column, Object value, Boolean validate)<BR>       ?? FarPoint.Win.Spread.SheetView.SetValue(Int32 row, Int32 column, Object value)<BR>       ?? SchemaCompare.Form1.Form1_Load(Object sender, EventArgs e) ?? C:\Documents and Settings\164\My Documents\Visual Studio 2005\Projects\SchemaCompare\SchemaCompare\Form1.cs:? 40<BR>       ?? System.Windows.Forms.Form.OnLoad(EventArgs e)<BR>       ?? System.Windows.Forms.Form.OnCreateControl()<BR>       ?? System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)<BR>       ?? System.Windows.Forms.Control.CreateControl()<BR>       ?? System.Windows.Forms.Control.WmShowWindow(Message& m)<BR>       ?? System.Windows.Forms.Control.WndProc(Message& m)<BR>       ?? System.Windows.Forms.ScrollableControl.WndProc(Message& m)<BR>       ?? System.Windows.Forms.ContainerControl.WndProc(Message& m)<BR>       ?? System.Windows.Forms.Form.WmShowWindow(Message& m)<BR>       ?? System.Windows.Forms.Form.WndProc(Message& m)<BR>       ?? System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<BR>       ?? System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<BR>       ?? System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<BR>       ?? System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)<BR>       ?? System.Windows.Forms.Control.SetVisibleCore(Boolean value)<BR>       ?? System.Windows.Forms.Form.SetVisibleCore(Boolean value)<BR>       ?? System.Windows.Forms.Control.set_Visible(Boolean value)<BR>       ?? System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<BR>       ?? System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<BR>       ?? System.Windows.Forms.Application.Run(Form mainForm)<BR>       ?? SchemaCompare.Program.Main() ?? C:\Documents and Settings\164\My Documents\Visual Studio 2005\Projects\SchemaCompare\SchemaCompare\Program.cs:? 17<BR>       ?? System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)<BR>       ?? System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)<BR>       ?? Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<BR>       ?? System.Threading.ThreadHelper.ThreadStart_Context(Object state)<BR>       ?? System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<BR>       ?? System.Threading.ThreadHelper.ThreadStart()<BR></P>
    <P>but "3.0.2008.2005" works ok, this seems that it's a bug of version "3.0.2010.2005"?</P>
    <P>what can i do? can anyone help me ?</P>
  • Replied 8 September 2017, 2:10 pm EST

    <P>Hello, </P>
    <P>We have tested this issue and its a bug in version 3.0. You can try upgrading Spread to version to 4.0 as it works fine there.</P>
    <P>Thanks.</P>
  • Replied 8 September 2017, 2:10 pm EST

    <P>Hi,</P>
    <P>To add on to what i have mentioned above, it seems that you are using the <SPAN>Japanese version of Spread and there is no version 4 for the Japanese Spread.</SPAN></P>
    <P>However this issue in Japanese Spread has already been reported as bug #27876. And you can have a look at the workaorund to this bug in this <A href="http://www.grapecity.com/Japan/Support/Search/BugContent.asp?id=27876">link</A> . </P>
    <P>Hope this will help. Thanks.<BR></P>
  • Replied 8 September 2017, 2:10 pm EST

    <P>Thank you very much.</P>
    <P>maybe i should back to 3.0.2008.2005<img src="/emoticons/emotion-6.gif" alt="Sad" /></P>
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels