Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. CTRL+C and CTRL+V in grid control

CTRL+C and CTRL+V in grid control

Scheduled Pinned Locked Moved C#
questioncsharpcssarchitecturehelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eli15021979
    wrote on last edited by
    #1

    Hi, I'm new to C# and .Net architecture , so sorry about the silly question.... :-\ . I'm using a grid control in order to display data from the data base. My problem is when the user press the CTRL+C in a specific cell in order to copy the data to a different cell. The result is that the new cell contain the data of the entire row , instead of the data of the copied cell. note that if I use the mouse right click and "copy" <-> "paste" it is working fine. My question is how can I capture the CTRL+C and CTRL+V with the keyboard? With best regards, Eli

    P 1 Reply Last reply
    0
    • E eli15021979

      Hi, I'm new to C# and .Net architecture , so sorry about the silly question.... :-\ . I'm using a grid control in order to display data from the data base. My problem is when the user press the CTRL+C in a specific cell in order to copy the data to a different cell. The result is that the new cell contain the data of the entire row , instead of the data of the copied cell. note that if I use the mouse right click and "copy" <-> "paste" it is working fine. My question is how can I capture the CTRL+C and CTRL+V with the keyboard? With best regards, Eli

      P Offline
      P Offline
      paas
      wrote on last edited by
      #2

      Are you talking about the DataGridView control? I don't seem to be having any sort of problem with CTRL-C, CTRL-V to copy and paste from cell to cell with that control. Anyways, you might take a look at the grid's KeyDown event and see if you can use the e.Modifiers to capture the Control key, and e.KeyCode to capture the 'C' or 'V', but, to be honest, I don't think that event will trigger in an editable cell of the DataGridView. The other option I can think of is to override ProcessCmdKey and see if you can capture the key combinations there.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups