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. DataGridView, changing active cell within events

DataGridView, changing active cell within events

Scheduled Pinned Locked Moved Windows Forms
questioncssdata-structureshelptutorial
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.
  • A Offline
    A Offline
    Antonino Porcino
    wrote on last edited by
    #1

    I have a DataGridView that triggers Parse, CellValidating and CellValueChanged events. I need to change the active cell in response of one of these events. For example, if the value of the cell is "1" I need to go to the third columns of the grid, and things like that. The problem is that apparently I can't change the active cell while I'm still in the event. If I do that, strange things happen, ranging from no effects to events calling themselves resulting in stack overflow. I managed to solve it with a dirty trick, but I am not satisfied yet. What is the correct way changing the active cell within an event?

    C 1 Reply Last reply
    0
    • A Antonino Porcino

      I have a DataGridView that triggers Parse, CellValidating and CellValueChanged events. I need to change the active cell in response of one of these events. For example, if the value of the cell is "1" I need to go to the third columns of the grid, and things like that. The problem is that apparently I can't change the active cell while I'm still in the event. If I do that, strange things happen, ranging from no effects to events calling themselves resulting in stack overflow. I managed to solve it with a dirty trick, but I am not satisfied yet. What is the correct way changing the active cell within an event?

      C Offline
      C Offline
      Calin Tatar
      wrote on last edited by
      #2

      Have you tried to change the active cell from CellValidated event handler? Calin

      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