Change of color after I paste the copied range

  • Purna Chandra Rao 2 years, 1 month ago


    I am very new to the FP Spreed.

    I open my Excel file using the FPSpreed. After opening , the Spreed is as expected, with all the Locked cells and unlocked cells and back colors etc..

    Wen i try try to paste some values in the unlocked cells , the back color is also changing. I dont want to change the back color.

    Please advice?

    thanks for your help in advance.

  • 82p
    Reeva82p 2 years, 1 month ago


    You can set the ClipboardPasteOptions to ‘Values’ for the same as given below:-

    ContextMenu cm = new ContextMenu();
    private void Form1_Load_1(object sender, EventArgs e)
        MenuItem paste = new MenuItem("paste");
        paste.Click += new EventHandler(paste_Click);
        MenuItem copy = new MenuItem("copy");
        copy.Click += new EventHandler(copy_Click);
        fpSpread2.ContextMenu = cm;
        fpSpread2_Sheet1.Cells[2, 2].BackColor = Color.Red;
    void paste_Click(object sender, EventArgs e)
    void copy_Click(object sender, EventArgs e)

    Hope it helps.


  • Purna Chandra Rao 2 years ago

    Hi Reeva,

    Thanks for your code.

    Above code is working if I paste the data from other Excel sheet to this Spreed.

    Its not working if I copy from the same Spreed .


  • 82p
    Reeva82p 2 years ago


    It works within the spread control as well but when you write this code on button click event or on ContextMenuItem click event.

    Hope it clarifies.


  • Purna Chandra Rao 2 years ago

    Thanks it works.

  • evano2l 6 days, 19 hours ago

    I am able to capture the pasting event in my grid’s base class, but only for the case where the user selects “Paste” from the context menu. I can’t figure out how to add this to the the keyboard shortcut (Ctrl+V). I would like for all grids using this base class to paste only values.

  • 108p
    Sean Lawyer108p 6 days, 3 hours ago


    Clipboard shortcut keys are mapped to clipboard actions in the input map. You can change the clipboard action for Ctrl+V using the input map API to set the ClipboardPasteValues action, or you can set the None action and handle the key in other code, where you can have more control over the paste (e.g. a menu command) using the ClipboardPaste method with ClipboardPasteOptions.Values.


Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to create new topics.