FlexSheet - Copy Paste Row Styling

Posted by: chetan.shetty on 21 August 2020, 9:30 am EST

  • Posted 21 August 2020, 9:30 am EST

    Hi,

    I am using FlexSheet grid in my application. I am facing issues when copy/pasting a row into another row in the grid. The Data gets copied perfectly but the styling isn’t.

    So, for example, a number datatype column in row 1 (say 1000) gets copied to row 2 as “1,00.00”. I have custom grid validations which are failing because of this. Is there any way to copy the styling as well and if possible can you show a small sample code for the same.

    • “Wijmo version consumed”

      : 5.20183.568

    Thank you.

    Regards,

    Chetan

  • Posted 24 August 2020, 1:07 am EST

    Hi Chetan,

    We are sorry but we were unable to replicate the issue at our end. Please refer to the sample link below that we used to replicate the issue:

    https://stackblitz.com/edit/js-po8vxp

    Can you please let us know whether we are missing something in order to replicate the issue? You could also modify the sample so that reproduces your issue.

    Regards,

    Ashwin

  • Posted 26 August 2020, 5:38 am EST - Updated 3 October 2022, 3:32 pm EST

    Let me explain the scenario to you.

    1. I have a row with some columns as type string and some columns as type number.
    2. I copy the entire row using the rowheader
    3. I add a new blank row and paste the copied row.

    On pasting, the new row copies values from the original row but not the styling.

    Do I need to handle styles while adding a new row to the grid or while pasting?

    Attaching a screenshot of the itemsSource after copy-paste:

  • Posted 27 August 2020, 1:53 am EST

    Hi Chetan,

    This is not a styling issue. The dataType of the Column (for example c2) is set according to the first item in the itemsSource. Since, the first item in c2 is 1, which is a number, so the dataType of that particular column is set to Number. So, now if you will the 2nd row to the 1st row, the string in the c2 of item 2 will be parsed as a number.

    To resolve this, you will need to set the dataType of that column to String. Please refer to the sample link below for reference:

    https://stackblitz.com/edit/js-guz9yw

    ~regards

  • Posted 22 September 2020, 7:27 am EST

    Hi Ashwin,

    that is the issue. The dataType is number because first value of c2 is a number and yet when I paste that value to new row, it converts into a string in the new row. In the previous screenshot, check the values of c2, c4, c5, c6, c10 for row 1 and row 2

  • Posted 23 September 2020, 6:50 am EST - Updated 3 October 2022, 3:32 pm EST

    Hi,

    I think I understand your issue. Your original data is item1 and when you copy and paste it in a different row, the data is converted to a string instead of remaining a number. Is my understanding correct?

    I tried to replicate this issue in the previous sample, but I was unable to do so.

    I updated the previous sample a little bit to replicate the issue. This is the updated sample:

    https://stackblitz.com/edit/js-eyfd7z

    Can you let me know whether I am missing something?

    ~regards

Need extra support?

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

Learn More

Forum Channels