Upgrade to v 4.0.3505 gives ArgumentOutOfRange Exception while setting RowCount to zero

Posted by: keren on 8 September 2017, 1:34 pm EST

  • Posted 8 September 2017, 1:34 pm EST


       I am getting an exception and can't understand why.

    It happens after I have filled the grid once, when I try to clear it (in order to refill it).
    Here is the code:

    <FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>void</FONT></FONT><FONT size=2> InitSpread()
    </FONT><FONT size=2>SetSpreadVariables();
    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT size=2> maxColumns = _models.Count - 1 + ColumnsStatic;
    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT size=2> maxRows = _artifactCount - 1 + RowStatic;

    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//Tooltip
    </FONT></FONT><FONT size=2>CalculationSpread.TextTipPolicy = </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>TextTipPolicy</FONT></FONT><FONT size=2>.Floating;
    CalculationSpread.TextTipDelay = 10;

    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//Clear spread
    </FONT></FONT><FONT size=2>CalculationSpread_Sheet1.ColumnCount = 0;
    <FONT color=#990000>CalculationSpread_Sheet1.RowCount = 0;</FONT>

    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//Rows and columns
    </FONT></FONT><FONT size=2>CalculationSpread_Sheet1.ColumnCount = maxColumns + 1;
    CalculationSpread_Sheet1.RowCount = maxRows + 1;</FONT>

    <FONT size=2>......</FONT>

    <FONT size=2>The exception accures on the line marked in red. It says:
    ArgumentOutOfRange Exception
    Invalid low bound argument.
    Parameter name: LargeChange</FONT>

    I have found this following link with the same problem:
    And tried to use ShowCell but it didn't help.

    <FONT size=2>This problem has started after upgrading to v. 4.0.3505.
    </FONT>Now I took away all referance to the new DLL and instead linked back to v 4.0.2001 and this doesn't happen.
    the very same code works fine.
    Is there anything about the new version or upgrading that I am missing?

    <FONT size=2>Thank you in advance,
    </FONT><FONT size=2>Keren

  • Replied 8 September 2017, 1:34 pm EST

    Keren -

    I believe this was similiar to a bug in that version you have which should be fixed in the maintenance release we will be posting soon.

  • Replied 8 September 2017, 1:34 pm EST

    I've been experiencing the exact same problem. This problem seems to occur randomly (but not very often).

    I'm glad to hear that this has been identified and will be fixed. Can you give me/us a date when the next maintenance release is?

    For my curiosity, can you tell me what the cause of the problem?



  • Replied 8 September 2017, 1:34 pm EST

    The maintenance should be out in the next couple of weeks.  I do not know what the cause of the problem was.
  • Replied 8 September 2017, 1:34 pm EST


    The problem was caused by setting the RowCOunt of the Spread to 0 after scrolling down the Spread so that row 0 is not the top row. You can programatically work around this now by using the SetViewportTopRow method to scroll to the top of the Spread before setting the RowCount to 0.

  • Replied 8 September 2017, 1:34 pm EST

    Hi Scott,

        I am not so sure that you are correct, at least not in my case. I press the "Get" buttom that reloads the spread twice without doing ANY scroll in between.  
    The problem still appears when pressing the second Get, every time.

    I have tride to put the following line before setting RowCount to 0:
    <FONT color=#008000 size=2><FONT color=#008000 size=2>CalculationSpread.ShowCell(0, 0, 0, 0, FarPoint.Win.Spread.VerticalPosition.Top, FarPoint.Win.Spread.HorizontalPosition.Left);
    <FONT color=#000000>But this did not help either. Is using the SetViewportTopRow method that you suggested different than what is done in the above line? (If yes, I will switch to the updated version again and try it). </FONT></FONT></FONT>

    <FONT color=#008000 size=2><FONT color=#008000 size=2><FONT color=#000000>Thanks in advance,
    </FONT></FONT></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2><FONT color=#000000>Keren</FONT>


  • Replied 8 September 2017, 1:34 pm EST


    There are two seperate bugs; both of which will be fixed in the maintenance release. One just requires scrolling the Spread a few rows and then setting the RowCount to 0. The other has to do with setting the RowCount to 0 when bound to a DataSource. I thought the second one gave a different exception but it sounds like you are saying they are both the same exception. Both issues will be fixed in the next maintenance release as stated by Bob.

  • Replied 8 September 2017, 1:34 pm EST


    We upgraded to the version 4.2008.2005 because of the same error in the version 4.2005.2005 as descripted (setting rowcount = 0 when bound to a datasource causes an error "The Value is not valid; the value must be between the minimum and the maximum values.", maybe the same effect setting the columncount = 0). But in version 4.2008.2005 the error still happens. So we are a little bit disappointed that the error is not fixed.  Is their a way to workaround this error?




  • Replied 8 September 2017, 1:34 pm EST


    I am not familiar with an issue like this with setting the ColumnCount to 0. Could you post a small zipped project reproducing this issue for us to debug?

Need extra support?

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

Learn More

Forum Channels