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. Adding a new row in a DataGrid

Adding a new row in a DataGrid

Scheduled Pinned Locked Moved Visual Basic
question
4 Posts 3 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
    dptalt
    wrote on last edited by
    #1

    When I move the cursor to the last row in my DataGrid a new record is added to the DataView. The new row fields contain DBNull values. When the new row is added how can I automatically assign values to these fields so they are not null? Thanks

    J 1 Reply Last reply
    0
    • D dptalt

      When I move the cursor to the last row in my DataGrid a new record is added to the DataView. The new row fields contain DBNull values. When the new row is added how can I automatically assign values to these fields so they are not null? Thanks

      J Offline
      J Offline
      jasonbullard
      wrote on last edited by
      #2

      Programmatically you do it like this. DataSet1.Tables("TABLE_NAME").Columns("COLUMN_NAME").DefaultValue = "Me" Otherwise go into your dataset properties and then tables and finally columns. Once there click on your column and find the property DefaultValue. HTH, Jason

      D 1 Reply Last reply
      0
      • J jasonbullard

        Programmatically you do it like this. DataSet1.Tables("TABLE_NAME").Columns("COLUMN_NAME").DefaultValue = "Me" Otherwise go into your dataset properties and then tables and finally columns. Once there click on your column and find the property DefaultValue. HTH, Jason

        D Offline
        D Offline
        dptalt
        wrote on last edited by
        #3

        What is the syntax when using the finally columns?

        A 1 Reply Last reply
        0
        • D dptalt

          What is the syntax when using the finally columns?

          A Offline
          A Offline
          Asim N
          wrote on last edited by
          #4

          Finally mean final step! Regards, Asim

          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