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. DataGridView in C#

DataGridView in C#

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

    I am using a DataGridView for getting input data from user. In RowLeave event of DataGridView i am checking the cells' values of the DataGridViewRow. There are chances that the user leave some fields empty. I check a certain cell say Column1. If it is empty i want this row should not leave the focus. How could i do that? Thanks.

    R 1 Reply Last reply
    0
    • P peshawarcoder

      I am using a DataGridView for getting input data from user. In RowLeave event of DataGridView i am checking the cells' values of the DataGridViewRow. There are chances that the user leave some fields empty. I check a certain cell say Column1. If it is empty i want this row should not leave the focus. How could i do that? Thanks.

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      Hi, try to use the RowValidating event instead. It has a Cancel property which you can set to true when the fields are not set correctly. Haven't used it so far but I think it should be what you need. Robert

      P 1 Reply Last reply
      0
      • R Robert Rohde

        Hi, try to use the RowValidating event instead. It has a Cancel property which you can set to true when the fields are not set correctly. Haven't used it so far but I think it should be what you need. Robert

        P Offline
        P Offline
        peshawarcoder
        wrote on last edited by
        #3

        With your cooperation i solved my problem. Thank you very much. I expect welcome from you.

        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