Copy, paste cells that contain multiple values

Posted by: matt_baker on 17 March 2021, 12:05 am EST

  • Posted 17 March 2021, 12:05 am EST

    What would be the best way to implement custom pasting behavior in a Flexgrid column?

    I have a FlexGrid in VueJS, with a column that has a binding to an array of integers that represent values. Using a DataMap and a CellTemplate, I am able to display the multiple values in a given cell.

    I would like to be able to select a cell in this column, copy it, and paste the contents to adjacent cells in the same column. It appears that the data is being pasted as a comma-separated list of integers, but that Wijmo cannot automatically transform it back to an array using its binding.

  • Posted 18 March 2021, 1:22 am EST

    Hi Matt,

    For your requirements, you can use the pastingCell event. The event.data property will contain the data being pasted. You can modify the value of this property according to your requirements.

    https://www.grapecity.com/wijmo/api/classes/wijmo_grid.flexgrid.html#pastingcell

    But, I was unable to replicate your issue. If you do not use a cell template, then the grid will automatically display the array values as comma-separated values and will also convert the pasted data into an array automatically.

    You can verify this from the sample below:

    https://codesandbox.io/s/sad-smoke-y6csb

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels