Adding the first row to the sheet bound to empty custom objects collection problem

Posted by: bo-jangles on 8 September 2017, 1:58 pm EST

  • Posted 8 September 2017, 1:58 pm EST

    Hi,


    If I bind Spread to empty custom objects collection using BindingSource and BindingNavigator, clicking the Add New button in the BindingNavigator does not create a new empty row. Subsequent cliks do create new rows but the grid is now out of sync with the number of objects in the source. Binding datatable works as expected.


    I've attached the small project that shows 3 scenarios:



    • Objecets to MS grid

    • Objects to FP Spread

    • DataTable to FP Spread

    Regards


     Bojan


    2009/07/FPSBindingtoObjects.zip
  • Replied 8 September 2017, 1:58 pm EST

    Bojan,

    I tried running the sample at my side, but could not run the same.it gave me Spread reference erros, I tried referencing the Spread 4.0.2010.2005 dlls, it still gave me the errors. Any additional steps required to be performed to run the sample project to reproduce the issue at our side?

    Thanks

  • Replied 8 September 2017, 1:58 pm EST

    Not that I know of. I've started the demo project from scratch in VS 2008. Target framework 3.5. Spread version 4.0.3501.2008.


    See attached references screen dump.


     Regards


     Bojan



  • Replied 8 September 2017, 1:58 pm EST

    Hello Bojan,

    I am able to run the sample provided by you once adding those references, however I am not able to reproduce the issue, I am using Latest version of Spread for Windows Forms with VS2008. This is what I tried in order to reproduce the issue,

    1. On Form Load I tried to add a new row to "FP Spread Objects" and to other grids as well which ends successfully.

    2. I checked the option Return Empty Set and clicked Reload where it returns "FP Spread Objects" and "FP Spread Data Table" with no rows. I click on add new button to add  a new row in all of the grids and I see that Rows are added with no problem and it shows the correct number there in the textBox.

     

    Let me know if I am missing something.

    Thanks,

  • Replied 8 September 2017, 1:58 pm EST

    Hello,


    thanks for the response. I must say I'm puzzled. I've struggled with this for two days and couldn't get it going in my 2005 project (which I couldn't send to you because of it's size). I've then decided to test the 2008 version and it didn't work too. I've tried again after your response and now it is intermittent.


    I can still reproduce it:


    check 'Empty Set' and Reload, Add record, Reload, Add Record, Add Record, Delete Record, Delete Record, Reload


    and it should happen. Basically you have to fiddle with it before it gets stuck. Once it's stuck you can reproduce the problem every time by


    Reload


    Add record


    sequence.


    See if you can figure it out. If not, don't worry to much.


    Regards


    Bojan


     

  • Replied 8 September 2017, 1:58 pm EST

    Hello Bojan,

    I tested again, and this time using Visual Studio 2008, and kept the application simple, and not able to reproduce the problem. I've trimmed the code a bit, and using BindingList only. Please run this application at your end, and confirm whether you are observing the same problem or not.

    Thanks,


    2009/07/SpreadBindMyList.zip
  • Replied 8 September 2017, 1:58 pm EST

    Hi, I can reproduce the problem with your app too.


     


    Here is what I do:


    Check Empty Set box


    Click Reload


    Add


    Add


    Delete


    Delete


    Click Reload


    Click Add and it happens, the navigation bar shows 1 for the number of records but there is no record in the grid. See the attached screen.


    Again, don't stress about it. I will find a workaround If I need one.


    Regards


    Bojan



Need extra support?

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

Learn More

Forum Channels