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. (nulls) display problem in datagrid new row

(nulls) display problem in datagrid new row

Scheduled Pinned Locked Moved Visual Basic
databasecsshelpquestion
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.
  • D Offline
    D Offline
    Danny van der Walt
    wrote on last edited by
    #1

    I have a Datagrid that is bound to a typed dataset that is loaded from a SQL database. While typing data in a new row on grid the other column cell values all contain the value "(null)".I cannot present something like this to a client. Is there any way of formatting the new row to present empty or default values ?

    G 1 Reply Last reply
    0
    • D Danny van der Walt

      I have a Datagrid that is bound to a typed dataset that is loaded from a SQL database. While typing data in a new row on grid the other column cell values all contain the value "(null)".I cannot present something like this to a client. Is there any way of formatting the new row to present empty or default values ?

      G Offline
      G Offline
      gpa2000
      wrote on last edited by
      #2

      Jazeker: My solution to this problem is to write a function ReplNull which returns a default when a value is Null: Public Function ReplNull(ByVal varSource As Variant, _ ByVal varReplaceBy As Variant) As Variant If IsNull(varSource) Then ReplNull = varReplaceBy Else ReplNull = varSource End If End Function Or use the CASE WHEN clause in your SQL statement to replace Nulls by your default. grtz, Guus

      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