Copy Paste & Hidden Column

Posted by: tkrimer on 8 September 2017, 2:11 pm EST

  • Posted 8 September 2017, 2:11 pm EST

    Hello


    I'm trying to implement the following.


    1. Copying from the spread into Excel, when there are some hidden columns in the spread - shouldn't copy from the hidden


    2. Pasting from Excel into the spread, when there are some hidden columns in the spread - the implementation should "skip" the invisible columns and not paste into them


    This is not the default implementation for ClipboardPaste and ClipboardCopy offered by the spread.


    What would be the right approach to acheive what I'm looking for?!


    Is there a way I can refine some how the default ClipboardPaste/Copy?


    Or should I implement my CustomClipboardPaste/Copy and mapping the "Ctrl+V" keystroke to my CustomClipboardPaste using the InputMap and ActionMap?


    Thank you

  • Replied 8 September 2017, 2:11 pm EST

    Hello,

    You are correct above mentioned scenarios are the default behavior of the Spread control. However, to skip the hidden columns from copying/pasting,you would need to programatically make sure a hidden cell is not
    selected in order for it's contents not to be copied. You can move the
    hidden columns to the beginning or end of your sheet and then
    programatically reselect the block you want to copy (not getting the
    hidden cells) and call the Spread's Copy method.

    The second way is by creating a new (hidden) SheetView and
    programatically copying the data from the non hidden columns into the
    new DataModel. Then you can programatically select the data in the
    hidden sheet and copy it to the clipboard.

    Thanks

     

  • Replied 8 September 2017, 2:11 pm EST

    Thank you SureshD


    Just to clarify...


    The implementation you're suggesting is writing my own CustomPasteAction and in there implementing the "You can move the hidden columns to the beginning or end of your sheet and then programatically reselect the block you want to copy (not getting the hidden cells) and call the Spread's Copy method." ?


    Is my understanding correct?

  • Replied 8 September 2017, 2:11 pm EST

    Hello,

    Yes, this is correct.

Need extra support?

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

Learn More

Forum Channels