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. Datagrid CurrentCellChanged problem

Datagrid CurrentCellChanged problem

Scheduled Pinned Locked Moved C#
helpquestion
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
    work_to_live
    wrote on last edited by
    #1

    I have an ArrayList bound to a datagrid. I've developed a method of validating the data entered in the TextBoxes, and forcing the user to re-enter invalid data. Unfortunately, I use the CurrentCellChanged event to test if it's necessary to move the selection back to the cell with the invalid data in it. It works fine with one exception. If you're at the end of a row of data, and press the TAB key (return is fine), you get an extra CurrentCellChanged event. The first one takes you to the beginning of the same row, and the next one takes you to the next row! This messes with my logic that determines if it's necessary to move the selection back to the cell with the error in it. Is there some way to inhibit the handling of the TAB key once you've determined that you want to select another cell?

    I 1 Reply Last reply
    0
    • W work_to_live

      I have an ArrayList bound to a datagrid. I've developed a method of validating the data entered in the TextBoxes, and forcing the user to re-enter invalid data. Unfortunately, I use the CurrentCellChanged event to test if it's necessary to move the selection back to the cell with the invalid data in it. It works fine with one exception. If you're at the end of a row of data, and press the TAB key (return is fine), you get an extra CurrentCellChanged event. The first one takes you to the beginning of the same row, and the next one takes you to the next row! This messes with my logic that determines if it's necessary to move the selection back to the cell with the error in it. Is there some way to inhibit the handling of the TAB key once you've determined that you want to select another cell?

      I Offline
      I Offline
      Ista
      wrote on last edited by
      #2

      Yeah but you gotta override the PreviewKeyMessage function. Also you need to creat a custom table style I'm not an expert yet, but I play one at work. Yeah and here too.

      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