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 formatting breaks validation

DataGridView formatting breaks validation

Scheduled Pinned Locked Moved Visual Basic
csharpcsshelptutorial
2 Posts 1 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
    penguin5000
    wrote on last edited by
    #1

    I've got a bound DataGridView that performs some validation exactly as I want it to - providing I don't have the columns formatted. A code snippet example of the validation that works when I don't format the columns is: If CType(e.ProposedValue, Integer) <= intPreviousToValue Then e.Row.RowError = "Error message" e.Row.SetColumnError(e.Column, "Error message") End If Using the standard VB.NET 2005 Express formatting properties, the columns are formatted to be: Column 0 - Numeric - no decimals Column 1 - Numeric - no decimals Column 2 - Currency - two decimals If I take the formatting out, the grid validation works fine - if I put the formatting back in, I can't get the validation to work. What am I breaking by putting the formatting in?

    P 1 Reply Last reply
    0
    • P penguin5000

      I've got a bound DataGridView that performs some validation exactly as I want it to - providing I don't have the columns formatted. A code snippet example of the validation that works when I don't format the columns is: If CType(e.ProposedValue, Integer) <= intPreviousToValue Then e.Row.RowError = "Error message" e.Row.SetColumnError(e.Column, "Error message") End If Using the standard VB.NET 2005 Express formatting properties, the columns are formatted to be: Column 0 - Numeric - no decimals Column 1 - Numeric - no decimals Column 2 - Currency - two decimals If I take the formatting out, the grid validation works fine - if I put the formatting back in, I can't get the validation to work. What am I breaking by putting the formatting in?

      P Offline
      P Offline
      penguin5000
      wrote on last edited by
      #2

      Anybody got any thoughts on this? One thing I forgot to say is that if I put a msgbox in place, when the conditions are met, it show the message - its just the errorprovider notification icon that I can't get.

      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