1 Replies - 605 Views - Last Post: 02 May 2011 - 12:56 PM Rate Topic: -----

#1 castro  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 51
  • Joined: 12-November 05

fill a datagrid with values from a textbox

Posted 02 May 2011 - 11:22 AM

hello all

i need a little help.

i am trying to fill a datagrid on form 2 with data from a textbox in form 1 but i can't find how to do this.

for moving of data across forms i can do that by
frm as new form2
frm.datagrid.datasource=ds.tables (i can do it)

but binding the text box to the datagrid is my worry.

i have 4 textboxes
text1
text2
text3
text4

and i want to populate the datagrid with all the content when i click a button( called Add)

how best can i handle this.

my research.
i can use an arraylist or build data tables but dont no how

counting on you all

Is This A Good Question/Topic? 0
  • +

Replies To: fill a datagrid with values from a textbox

#2 castro  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 51
  • Joined: 12-November 05

Re: fill a datagrid with values from a textbox

Posted 02 May 2011 - 12:56 PM

i tried this but it did not show anything
 Dim ds As New DataSet

     
        Dim dt As New DataTable()

        Dim frm As New frmRegister
        dt.Columns.Add(New DataColumn("Location", GetType(String)))
        dt.Columns.Add(New DataColumn("IP", GetType(String)))
        dt.Columns.Add(New DataColumn("Status", GetType(String)))
        dt.Rows.Add(New String() {Me.txtChildFullname.Text, txtChildFullname.Text, txtChildFullname.Text})
        dt.Rows.Add(New String() {txtChildFullname.Text, txtChildFullname.Text, txtChildFullname.Text})

        frm.dgChildren.DataSource = dt

This post has been edited by modi123_1: 02 May 2011 - 01:01 PM
Reason for edit:: please use code tags

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1