Insert and Delete after binding to Datasource

5 posts, 0 answers
  1. Ani
    Ani avatar
    3 posts
    Member since:
    Jan 2016

    Posted 11 Apr Link to this post

    Hi, 

      how to perform insert and delete operation after binding to a dataSource. I tried to solve in different ways but all ends in some issue.

      Create a dojo snippet to reproduce issue.

      Issues :-

      1.  After applying formula to a column data sheet.range("F2:F").formula("C2*D2");   try to add a row 

           Getting error - kendo.all.js:98306 Uncaught Error: Shifting nonblank cells off the worksheet is not supported!

       2. Change formula to sheet.range("F2:F14").formula("C2*D2"); leaving one final row.  Can insert one record.

           Is there any way to apply formula to all cells in column without affecting the add functionality.

      3. " dataSource.cancelChanges()" will  copies the below row to current row.

       

     

  2. Ani
    Ani avatar
    3 posts
    Member since:
    Jan 2016

    Posted 11 Apr Link to this post

    Which is the best way to perform CRUD operation in spreadsheet when bind to datasource.

    for inserting -   spreadsheet.insertRow( )  or  dataSource.insert

  3. Kendo UI is VS 2017 Ready
  4. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 14 Apr Link to this post

    Hello Ani,

    Adding a formula to the spreadsheet marks it as containing data. Thus, when you add the formula to all rows, you fill out the complete spreadsheet with rows with default data. You may want to insert the formula only on actual data rows.

    Inserting rows via the DataSource may be easier to reason about. Note that formulas are not persisted, and you may need to add formulas to the rows after inserting new records.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. Ani
    Ani avatar
    3 posts
    Member since:
    Jan 2016

    Posted 26 Apr in reply to Alex Gyoshev Link to this post

    Hi Alex, 

     Thanks for the response. 

     

    Inserting rows via the DataSource may be easier to reason about. Note that formulas are not persisted, and you may need to add formulas to the rows after inserting new records

     

     That mean we need to add formulas to the newly inserted row only.

     What happening now is formulas are getting cleared for all cells after inserting new row. Is it an expected behaviour

  6. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 28 Apr Link to this post

    Hello Ani,

    What I meant in my previous post was that you can apply formulas to cells after a new row has been inserted. Can you please elaborate what problem you are facing?

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready