Results 1 to 3 of 3

Thread: Data Grid Help

  1. #1

    Thread Starter
    Junior Member 13-yearold-programmr's Avatar
    Join Date
    Jan 2010
    Posts
    26

    Unhappy Data Grid Help

    i currently have 2 forms. One has a datagrid and the other has places to type inforamtion into, witch when you press a button it Should appear on the data grid. My problem is for each different textbox field i enter (Firstname, Lastname, Dob ect..) i want each of them to go on a different column By using the scrip

    Code:
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Database.DataGridView1.Rows.Add(Add_FirstName.Text)
        End Sub
    it automaticly goes to the first column, but i dont know how to make it go to the second.

    please help me.
    -Thanks
    I wonder how much hangtime an giraffes crap has..?

  2. #2
    Hyperactive Member guyvdn's Avatar
    Join Date
    Oct 2002
    Location
    Belgium
    Posts
    336

    Re: Data Grid Help

    You will have to use the Insert method of the Rows collection. This allows you to choose the position of the row to add and a ParamArray of the values


    VB.Net Code:
    1. Database.DataGridView1.Rows.Insert(Database.DataGridView1.Rows.Count - 1, Add_FirstName.Text, Add_LastName.Text, Add_DOB.Text)
    To deny our own impulses is to deny the very thing that makes us human

  3. #3

    Thread Starter
    Junior Member 13-yearold-programmr's Avatar
    Join Date
    Jan 2010
    Posts
    26

    Re: Data Grid Help

    Thanks, you helped alot :thums:
    I wonder how much hangtime an giraffes crap has..?

Tags for this Thread

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