DataGridView without databinding?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Wright

    #1

    DataGridView without databinding?

    I have set up a datagrid on my form with six columns. I want to capture the
    data from six textboxes on the form and add them to the datagrid. All the
    info I can find about this is with datatables and databinding. I don't want
    to databind this, this is only a repository for data until the user clicks
    the save button. Then I will iterate through the grid rows and insert the
    data. Does anyone have code to populate a gridview from textboxes on a form
    without databinding?

    John


  • =?Utf-8?B?VGVycnk=?=

    #2
    RE: DataGridView without databinding?

    DataGridView.Ro ws.Add(TextBox1 , TextBox2, ....)
    --
    Terry


    "John Wright" wrote:
    I have set up a datagrid on my form with six columns. I want to capture the
    data from six textboxes on the form and add them to the datagrid. All the
    info I can find about this is with datatables and databinding. I don't want
    to databind this, this is only a repository for data until the user clicks
    the save button. Then I will iterate through the grid rows and insert the
    data. Does anyone have code to populate a gridview from textboxes on a form
    without databinding?
    >
    John
    >
    >
    >

    Comment

    • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

      #3
      RE: DataGridView without databinding?

      When the user click the button, you will put code in the button handler
      similar to the following:

      Dim row as Int
      row = datagrid1.Rows. Add()
      datagrid1.Rows( row).Cells(0).V alue = TextBox1
      datagrid1.Rows( row).Cells(1).V alue = TextBox2
      ' and so on...


      "John Wright" wrote:
      I have set up a datagrid on my form with six columns. I want to capture the
      data from six textboxes on the form and add them to the datagrid. All the
      info I can find about this is with datatables and databinding. I don't want
      to databind this, this is only a repository for data until the user clicks
      the save button. Then I will iterate through the grid rows and insert the
      data. Does anyone have code to populate a gridview from textboxes on a form
      without databinding?
      >
      John
      >
      >
      >

      Comment

      • =?Utf-8?B?VGVycnk=?=

        #4
        RE: DataGridView without databinding?

        sorry... s/b
        MyDataGridView. Rows.Add(Textbo x1.Text, TextBox2.Text, ...)

        the Rows.Add has an overload that takes a ParamArray of values for the
        columns which I am using here.
        --
        Terry


        "Terry" wrote:
        DataGridView.Ro ws.Add(TextBox1 , TextBox2, ....)
        --
        Terry
        >
        >
        "John Wright" wrote:
        >
        I have set up a datagrid on my form with six columns. I want to capture the
        data from six textboxes on the form and add them to the datagrid. All the
        info I can find about this is with datatables and databinding. I don't want
        to databind this, this is only a repository for data until the user clicks
        the save button. Then I will iterate through the grid rows and insert the
        data. Does anyone have code to populate a gridview from textboxes on a form
        without databinding?

        John

        Comment

        • John Wright

          #5
          Re: DataGridView without databinding?

          Thanks one and all for the help. I thought it was something along these
          lines you helped fill in the blanks. I am off and running.

          John
          "Family Tree Mike" <FamilyTreeMike @discussions.mi crosoft.comwrot e in
          message news:A86F44CB-4AB3-4D76-A773-2F1087C0301B@mi crosoft.com...
          When the user click the button, you will put code in the button handler
          similar to the following:
          >
          Dim row as Int
          row = datagrid1.Rows. Add()
          datagrid1.Rows( row).Cells(0).V alue = TextBox1
          datagrid1.Rows( row).Cells(1).V alue = TextBox2
          ' and so on...
          >
          >
          "John Wright" wrote:
          >
          >I have set up a datagrid on my form with six columns. I want to capture
          >the
          >data from six textboxes on the form and add them to the datagrid. All
          >the
          >info I can find about this is with datatables and databinding. I don't
          >want
          >to databind this, this is only a repository for data until the user
          >clicks
          >the save button. Then I will iterate through the grid rows and insert
          >the
          >data. Does anyone have code to populate a gridview from textboxes on a
          >form
          >without databinding?
          >>
          >John
          >>
          >>
          >>

          Comment

          Working...