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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Del row from Datagrid

Del row from Datagrid

Scheduled Pinned Locked Moved Visual Basic
css
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.
  • P Offline
    P Offline
    Paps2
    wrote on last edited by
    #1

    Hi All, I have populated my DataGrid1 from the dataTable. When I select the record and hit the 'DEL' key it removes the record from the grid. I would like to prompt the user on 'DEL' keypress and then remove the row from the grid. Is this possible. Tnx

    D 1 Reply Last reply
    0
    • P Paps2

      Hi All, I have populated my DataGrid1 from the dataTable. When I select the record and hit the 'DEL' key it removes the record from the grid. I would like to prompt the user on 'DEL' keypress and then remove the row from the grid. Is this possible. Tnx

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Should be easy enough. Handle the DataGrid KeyPress event. When the event fires, you're code show put up a modal dialog box (.ShowDialog()) asking if it's OK or not. If it is OK, set the eventargs parameter to False before your handler exits, otherwise set it to True to stop the keypress from reaching the DataGrid control and having it delete the record. KeyPress event[^] RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      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