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. Windows Forms
  4. Skip readonly columns in DataGridView

Skip readonly columns in DataGridView

Scheduled Pinned Locked Moved Windows Forms
help
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.
  • W Offline
    W Offline
    WILLIAM MAIN
    wrote on last edited by
    #1

    I have a DataGridView on a form with a number of columns that are calculated and hence set to readonly. What I wanted was to have these columns skipped whenever the user entered them. I thought to use the OnEnter event to test the readonly attribute of the current cell and set the currentcell to the next one. A problem arose using this methed in that by changing the currentcell in the event handler, I was invoking the non-reentrant changedcell method. Instead I resorted to a SendKeys.Send("{tab}") instead and this appears to work.

    K 1 Reply Last reply
    0
    • W WILLIAM MAIN

      I have a DataGridView on a form with a number of columns that are calculated and hence set to readonly. What I wanted was to have these columns skipped whenever the user entered them. I thought to use the OnEnter event to test the readonly attribute of the current cell and set the currentcell to the next one. A problem arose using this methed in that by changing the currentcell in the event handler, I was invoking the non-reentrant changedcell method. Instead I resorted to a SendKeys.Send("{tab}") instead and this appears to work.

      K Offline
      K Offline
      Kschuler
      wrote on last edited by
      #2

      I had this same issue a while back. I did some searching and posted on forums and the SendKeys.Send("{Tab}") solution was the only one I was able to find. Let me know if you find something better.

      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