FormatException on CheckBoxCellType after migrate from 2.0 to 2.5

Posted by: marcv on 8 September 2017, 12:48 pm EST

  • Posted 8 September 2017, 12:48 pm EST


    We are using VS2003 with 1.1 framework and our software is working pretty well with the Spread for Winforms 2.0. As we 'd like to get fixes about some old bugs, we try to migrate to 2.5 and we have some exceptions when we try to enable/disable checkbox in cells with the command :

    spdArticles_Sheet1.Cells[i,COL_SEL_ARTICLE].Value = true;

    Is there a migrate user's guide or some changes to do when migrating from 2.0 to 2.5 with VS2003 and framework 1.1 ?


  • Replied 8 September 2017, 12:48 pm EST


    Are you trying to enable/disable the checkbox, or just check/uncheck the checkbox programatically with your code? What exception(s) are you seeing? You should be able to use the same code with both versions of Spread for Windows Forms. Could you post a small zipped project reproducing this behavior for us to debug?

  • Replied 8 September 2017, 12:48 pm EST


    I just try to check/uncheck the checkbox with my code (the spread is not visible at that moment) and the FormatException raises (incorrect input string format). It works fine when I put a string in a standard cell.

    Thanks for your help

  • Replied 8 September 2017, 12:48 pm EST


    Here is code where I create a FpSpread object, set the CellType to CheckBoxCellType and set the Value for some cells. Then, I add the FpSpread object to the Controls collection of the form and make it Visible. I do not see any exception. Could you test my code and see what is different from your code?

    		<SPAN class=kwd>Dim</SPAN> ss <SPAN class=kwd>As New</SPAN> FarPoint.Win.Spread.FpSpread
    ss.Width = 400
    ss.Height = 400
    ss.Sheets.Count = 1
    <SPAN class=kwd>Dim</SPAN> c <SPAN class=kwd>As New</SPAN> FarPoint.Win.Spread.CellType.CheckBoxCellType
    ss.Sheets(0).Columns(1).CellType = c
    <SPAN class=kwd>For</SPAN> i <SPAN class=kwd>As Integer</SPAN> = 0 <SPAN class=kwd>To</SPAN> 100
    <SPAN class=kwd>If</SPAN> i <SPAN class=kwd>Mod</SPAN> 3 <SPAN class=kwd>Then</SPAN>
    ss.Sheets(0).Cells(i, 1).Value = <SPAN class=kwd>True
    End If

    ss.Visible = <SPAN class=kwd>True</SPAN>
Need extra support?

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

Learn More

Forum Channels