Results 1 to 29 of 29

Thread: [RESOLVED] [2008] How to add new row to datagridview?

Threaded View

  1. #1

    Thread Starter
    Lively Member mahammad()'s Avatar
    Join Date
    Jun 2008
    Location
    Cairo , Egypt
    Posts
    71

    Resolved [RESOLVED] [2008] How to add new row to datagridview?

    Can anyone helpme In adding new row to DataGridView?

    I tried this but it didn't work
    vb Code:
    1. Dim _row As DataGridViewRow
    2.         _row.Cells(0).Value = "Value1"
    3.         _row.Cells(1).Value = "Value2"
    4.         DataGridView1.Rows.Add(_row)

    it just give one Warning in the Error list saying
    Variable '_row' is used before it has been assigned a value. A null reference exception could result at runtime.
    and after dubug it highlight this part
    vb Code:
    1. _row.Cells(0).Value = "Value1"

    and type this
    Object reference not set to an instance of an object.
    help plz
    thnx
    Last edited by mahammad(); Aug 31st, 2008 at 07:24 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width