Unable to paste into other applications with SpreadActions.ClipboardCopyValues

Posted by: aspnetdev on 8 September 2017, 2:59 pm EST

  • Posted 8 September 2017, 2:59 pm EST

    I have following input map in one of my spread controls.

                    FarPoint.Win.Spread.InputMap im = new FarPoint.Win.Spread.InputMap();
                    FarPoint.Win.Spread.Keystroke ks;

                    im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
                    ks = new FarPoint.Win.Spread.Keystroke(Keys.C, Keys.Control);
                    im.Put(ks, SpreadActions.ClipboardCopyValues);

    I am setting this input map to just copy the values of the spread in the Clipboard. So when I paste this into the other spread it works fine and only the values are getting pasted. But when I try to paste into other application (e.g. Excel or Notepad) nothing gets pasted. 

    Can you please suggest why I am not able to paste into other apps with this input map settings ?

    Here is the background of what I am trying to achieve : I need this input map because in my windows form I have multiple spread controls. Lets say SpreadA, SpreadB and SpreadC. SpreadA and SpreadB are readonly. And spreadC is fully editable. So when user copies something from SpreadA or SpreadB and try to paste into SpreadC - I want the behavior so that only values  gets pasted (not the format). But I still want ability to paste everything when user copy something from SpreadC and paste that into the same spread. To achieve this, I thought limiting the default Ctrl+C action to ClipboardCopyValues in SpreadA and SpreadB will be good enough.This code works fine. But now, I do not have ability to do copy and paste from SpreadA or SpreadB to other applications.

  • Replied 8 September 2017, 2:59 pm EST

    ClipboardCopyValues uses the CellInfoRange class to put the data on the clipboard and copies only the values in the range to the info object.  That class can only be recognized by Spread for pasting.

    To paste values into other applications, you can use ClipboardCopyAsString instead.  That will copy a tab-delimited string like Excel (it can be pasted into Excel directly).

  • Replied 8 September 2017, 2:59 pm EST

    Thanks Sean. I am now using ClipboardCopyAsString option and it works fine.
Need extra support?

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

Learn More

Forum Channels