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. validation in datagrid

validation in datagrid

Scheduled Pinned Locked Moved Visual Basic
questionhelp
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.
  • K Offline
    K Offline
    kowplunk
    wrote on last edited by
    #1

    right now I am dealing with validation errors with this after the data has been processed determining if there is an error If isValid Then 'will clear the error for the row e.Row.ClearErrors() Else 'prevents the invalid changes from being submitted e.Row.AcceptChanges() End If It works, just the way that it should, but the logic is odd in that I have to AcceptChanges(). I do understand what is happening, but if someone else who is unaware of what happens in the acceptChanges method they would scratch their head. So is there a better way of doing this?

    A 1 Reply Last reply
    0
    • K kowplunk

      right now I am dealing with validation errors with this after the data has been processed determining if there is an error If isValid Then 'will clear the error for the row e.Row.ClearErrors() Else 'prevents the invalid changes from being submitted e.Row.AcceptChanges() End If It works, just the way that it should, but the logic is odd in that I have to AcceptChanges(). I do understand what is happening, but if someone else who is unaware of what happens in the acceptChanges method they would scratch their head. So is there a better way of doing this?

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      When invoking AcceptChanges, the EndEdit method is implicitly called to end any edits. If the RowState of the row was Added or Modified, the tee cref="System.Data.DataRow.RowState"/> becomes Unchanged. If the RowState was Deleted, the row is removed. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassacceptchangestopic.asp

      K 1 Reply Last reply
      0
      • A Anonymous

        When invoking AcceptChanges, the EndEdit method is implicitly called to end any edits. If the RowState of the row was Added or Modified, the tee cref="System.Data.DataRow.RowState"/> becomes Unchanged. If the RowState was Deleted, the row is removed. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassacceptchangestopic.asp

        K Offline
        K Offline
        kowplunk
        wrote on last edited by
        #3

        that makes sense. Thanks

        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