ClipboardCopy skips all cells after it finds a spanned cell

Posted by: imgodot on 19 October 2017, 5:21 am EST

    • Post Options:
    • Link

    Posted 19 October 2017, 5:21 am EST

    I think the title says it all.

    We have a grid that displays some rows with some cells that are spanned.

    When we copy it to the clipboard, it copies all the rows and cells properly until it finds a spanned cell. When we paste the copied data into Notepad we only get the data up to the first spanned cell. Everything from the spanned cell and after are not part of the copy.

    Here is the code:

            gridToUse.Sheets(0).OperationMode = FarPoint.Win.Spread.OperationMode.Normal
    
            ' Copy row headers and columns 0 to max.
    
            gridToUse.Sheets(0).SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.MultiRange
    
            Call gridToUse.Sheets(0).AddSelection(-1, -1, -1, -1)
    
            ' Copy to clipboard then clear the selection.
    
            Call gridToUse.Sheets(0).ClipboardCopy(FarPoint.Win.Spread.ClipboardCopyOptions.All)
    
  • Posted 20 October 2017, 5:10 am EST

    ADDENDUM TO ORIGINAL POST:

    I created a test app that does spanning in two ways:

    1. By creating the span in the Spread designer, and
    2. Creating the span programmatically.

      Note: The app with the original issue does things like (2) in my test app.

    Neither of these span tests behave like in the original post.

    In both cases, when I copy to the clipboard and paste into Excel, there is no spanned/merged cells at all.

  • Posted 23 October 2017, 9:05 pm EST

    Hello,

    This is the design behavior of Spread control wherein spanned and merged cells aren’t pasted to excel.

    Thanks,

    Reeva

Need extra support?

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

Learn More

Forum Channels