Copy & paste with hotkeys is not possible

Posted by: basti on 8 September 2017, 1:26 pm EST

  • Posted 8 September 2017, 1:26 pm EST

    Hello!


    I'm working with VisualStudio 2005 and the FarPoint Spread Window Forms version 4.0.


    It is not possible for me to copy and paste one cell in a FarPoint spread sheet by hotkeys (ctrl+c and ctrl+v).


    When I'm trying it with a right-click on a cell, it works fine. I get a context menu and can select my operations. But I like to do this via hotkeys.


    How can I realize it?


    The CheckBock "AutoClipboard" in the SpreadView is checked. So it should be true!


    Why is it not working?


    I hope you can help me.


    Thanks in advance!


     


    Sebastian

  • Replied 8 September 2017, 1:26 pm EST

    Sebastian,


    By default, this should be working. What exact problem are you having? Are you going into editmode to copy and/or paste, or you doing this outside of editmode? Are you copying only in Spread, or to/from another application? Is one of these actions working (copy or paste) and the other not, especially to/from an outside source? How do you have your Spread control set up.


    If you are using custom celltypes, make sure you have marked them Serializable in order to copy those cells.

  • Replied 8 September 2017, 1:26 pm EST

    The Spread is fixed in a tabpage... I dont't know if that is the problem.


    I tryed to copy data from the spread and pasting it to Notepad, but it didn't work. Also I tryed copying data from Notepad and pasting it into the spread and it also didn't work.


    But it is possible to copy and paste data via right-mouse click in both ways.


    I can't understand why it is possible to copy and paste via mouse but not via keyboard shortkeys.


    I would like to send you our project, but I'm not allowed to do that!


    Could you please tell me what I should activate, that copy and paste is possible by default... or maybe you have a solution for us?!


     

  • Replied 8 September 2017, 1:26 pm EST

    Hello,


    It sounds like something has been set to remove these InputMaps from the Spread or there is something else in the application that is catching the keystroke. Could you try copying data from Spread and pasting to Notepad to see if the Copy works? Also try copying data from Notepad and pasting to Spread to see if that works? Could you post a small zipped project reproducing the behavior you are seeing for us to debug?

  • Replied 8 September 2017, 1:26 pm EST

     


    The problem is, that nothing happens when I'm pushing the crtl+c or ctrl+v combination.


    I'm in the editmode and the text of the cell is marked. I can copy and paste it via right mouse-click but not via hotkeys.


    I also only want to copy cells in a Spread, not from another application. My cells are marked as Text-Cells.


    So I don't know where the problem is.


     

  • Replied 8 September 2017, 1:26 pm EST

    Hello,


    I used Spy to see where the keystrokes were going and did see one of the menus was processing the keystroke. I then went to the designer and saw on your MenuStrip and Edit menu item that had a Copy and Paste item mapped with the Ctrl-C and Ctrl-V. I removed these menu items and all is working.


    If you were to draw a textbox on the child form, you can not copy and paste from it as well with the menu item still set.

  • Replied 8 September 2017, 1:26 pm EST

    The mdi frm further contains a toolstrip, a tabcontrol and a menustrip...

  • Replied 8 September 2017, 1:26 pm EST

    Hello,


    Are you sure the ToolStrip or MenuStrip do not have accelerators set up for the Ctrl-C and Ctrl-V keystrokes? Could you post a small zipped project reproducing this behavior for us to debug?

  • Replied 8 September 2017, 1:26 pm EST

    Well i zipped the project for you. The forms that are involved are called TestSpread and TestMDI. You only need to comment and uncomment the cases you like to test. thanks in advance.


    2008/08/Quap_aktuel.zip
  • Replied 8 September 2017, 1:26 pm EST

    I found out that copy & paste works fine as long as the spread is embedded only in a standalone form. But if i use the form as a mdi's subform, copy and paste via shotcut keys doesn't work anymore. I tried setting breakpoints in the mdi form, as well in the menustrip to determine if key stroke handler methods are called, maybe catching the event and don't passing it through to the grid, but they were not involved. Do you have further ideas?....  

  • Replied 8 September 2017, 1:26 pm EST

    The problem is, that we need these Items/ toolbars!


    Is there no way to use ctrl-c and ctrl-v in the spread without removing the MenueStrip and EditMenueItem?

  • Replied 8 September 2017, 1:26 pm EST

    Hello,


    The editor that comes up in the Spread is basically a textbox, so the copy that happens from the ContextMenu is a straight windows copy of the selected text. The Control-C has to be processed as a keystroke before it copies the data. Anything can capture this keystroke and handle it before the Spread will. If you have an Accelerator key in a menu on your application, this can catch this keystroke. You mentioned you are on a tabpage. It is possible for them to capture the keystroke to process before Spread. I would suggest taking the Spread control off the tabpage to see if this fixes the issue. If it does not, look for other parts of your application that may be capturing this keystroke.

  • Replied 8 September 2017, 1:26 pm EST

    don't call me a fool but where excatly can i disable these mapping :)
  • Replied 8 September 2017, 1:26 pm EST

    Hello,


    What are you using the Delete key to do? Are you trying to delete the contents of a cell in editmode one character at a time, or do you have code to catch the keystroke and remove the entire cell? You would need ot look through both menus to see if a shortcut key to the Del key is mapped.

  • Replied 8 September 2017, 1:26 pm EST

    Thanks!


    Now everything works.... except the del-Key... how can I activate this key for the spread?

  • Replied 8 September 2017, 1:26 pm EST

    Hello,


    At design time, click on your MenuStrip at the Edit->Copy menu item and remove the property setting for the ShortCutKeys property (which is currently set to Ctrl-C).

  • Replied 8 September 2017, 1:26 pm EST

    Hello,


    All you need to do is to remove the Shortcut key assigned to the Copy and paste items. In the demo you sent to me, you are not even displaying the Edit menu.

Need extra support?

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

Learn More

Forum Channels