Start New Discussion within our Software Development Community

Hey guys.... really need your help?

I'm working in VB C# 2010.... I have a windows form application where i want the texts from multiple texboxes to be added to the dataGridView as one row...
can someone please tell me where to start?

As far as I know you have to follow these steps to add values from TextBox to dataGridView:
1- Fisrt of all Create a Data Table (Let's call it MyTable)
DataTable MyTable = new DataTable();
2- You are right! Now we need to create Column for our Tbale ( using DataColumn)
DataColumn clm = new DataColumn("Column1");
DataColumn clm2 = new DataColumn("Column2");
3- Now Add the Columns to the Table
4- Time to Create Rows,
DataRow rd = MyTable.NewRow();
5- Populate the rd with text value
rd[0] = textBox1.Text;
rd[1] = textBox2.Text;
6- Add Rows to the MyTable
7- Finally populate the dataGridView object with MyTable
dataGridView1.DataSource = MyTable;

Hopes this help you,

This question has already been answered. Start a new discussion instead.