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. Visual Basic
  4. DataGridView.CellValueChanged - value not firing until out of the combobox cell

DataGridView.CellValueChanged - value not firing until out of the combobox cell

Scheduled Pinned Locked Moved Visual Basic
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.
  • M Offline
    M Offline
    Marcus J Smith
    wrote on last edited by
    #1

    I have some DataGridViewComboBoxColumns in my datagridview. I have all of the code working correctly but I would like to find a way to have the CellValueChanged event fire when the new value is selected in the comboboxcolumn and not after a value is selected AND I click outside of that cell to commit it.


    CleaKO

    "Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)

    D 1 Reply Last reply
    0
    • M Marcus J Smith

      I have some DataGridViewComboBoxColumns in my datagridview. I have all of the code working correctly but I would like to find a way to have the CellValueChanged event fire when the new value is selected in the comboboxcolumn and not after a value is selected AND I click outside of that cell to commit it.


      CleaKO

      "Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)

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

      The Cell value won't change until the cell loses focus. Until then, you're still editing it. The Cell's value doesn't pickup the value of the ComboBox until focus is lost. This is when the SetValue method of the DataGridViewComboBoxCell is finally called, which sets the value of the DataGridViewCell, which fires the CellValueChanged event. The DataGridViewCombBoxCell doesn't expose any events itself, so I don't know how you're going to know when the ComboBox value changes.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      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