How to improving execution efficiency while binding data of spread grid?

Posted by: knightmade on 8 September 2017, 1:17 pm EST

  • Posted 8 September 2017, 1:17 pm EST

    I have a mass of records(about 100,000 records) to bind to spread grid(for .net).

    At present I fill data into every cell one by one, it spends a long time, over 30 minutes.

    Is there any way else to bind data quickly?

  • Replied 8 September 2017, 1:17 pm EST

    What method are you using to put the values in the cells.  Your performance will improve if you use the Value property rather than the Text property.  You can also call the SuspendLayout method prior to populating the cells and the call ResumeLayout when you are done.
  • Replied 8 September 2017, 1:17 pm EST

    It does not sound like you are using true data binding - if you are iterating through the control and setting values into the cells you are working with the control in unbound mode.

    If you create a data bindable object (like a dataset) and bind it to the Spread control (by setting the object into the DataSource property) you should see the data show up in the control instantly.
  • Replied 8 September 2017, 1:17 pm EST

    BobM:
    What method are you using to put the values in the cells.  Your performance will improve if you use the Value property rather than the Text property.  You can also call the SuspendLayout method prior to populating the cells and the call ResumeLayout when you are done.


    Yes! It works! Thank you very much.
  • Replied 8 September 2017, 1:17 pm EST

    robt:
    It does not sound like you are using true data binding - if you are iterating through the control and setting values into the cells you are working with the control in unbound mode.

    If you create a data bindable object (like a dataset) and bind it to the Spread control (by setting the object into the DataSource property) you should see the data show up in the control instantly.


    Maybe you are right, but there are lots of merged cells in my report table, I think I have to working in unbound mode...
  • Replied 8 September 2017, 1:17 pm EST

    Hello,


    If you are merging the cells, then there is no need to work unbound. Spread will automatically merge cells next to each other with the same data into one cell when you turn on merging.

Need extra support?

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

Learn More

Forum Channels