make a table and add rows in a button click

Posted by Shailesh21235 under C# on 11/12/2013 | Points: 10 | Views : 1790 | Status : [Member] | Replies : 7
i am new to windows application development. i want to make a table with 3 columns and row and keep adding row in a button click as required. i know about table layout but how to add values in table. is it in textbox??

thanks in advance




Responses

Posted by: Bandi on: 11/12/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer
http://www.codeproject.com/Articles/10770/Insert-a-New-Row-using-DataGrid-Hidden-Columns

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Shailesh21235, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/12/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Sample code to bind SQL table data to a DataGridView in Win forms
http://msdn.microsoft.com/en-us/library/fbk67b6z.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Shailesh21235, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shailesh21235 on: 11/12/2013 [Member] Starter | Points: 25

Up
0
Down
thanks for help Chandu,
but i was talking about the table in windows form not in asp.net.
a table where datas can be stored in each row and later sotred in database.
thanks in advance.

Shailesh21235, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/12/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer http://forums.codeguru.com/showthread.php?495888-RESOLVED-Create-table-in-Windows-Forms

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Shailesh21235, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/12/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer this link
http://stackoverflow.com/questions/1142873/winforms-tablelayoutpanel-adding-rows-programatically

Let me know the purpose of making table in win forms

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Shailesh21235, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shailesh21235 on: 11/12/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Bandi,
i have a form which has a column values of name, address and phone number.
There are many record so i want to store them in table. And according to increasing data i want to add a row in the table to enter new records.
DO you have any suggestions.
thanks

Shailesh21235, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/12/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
code for adding new row to tableLayoutPanel
        private void button1_Click(object sender, EventArgs e)

{
int rowCount = tableLayoutPanel1.RowCount;

tableLayoutPanel1.Controls.Add(new TextBox(), 0, rowCount+1 ); // add textbox in column0
tableLayoutPanel1.Controls.Add(new TextBox(), 1, rowCount + 1); // add textbox in column1
tableLayoutPanel1.Controls.Add(new TextBox(), 2, rowCount + 1); // add textbox in column2

tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 30)); // 30 is the rows space
}


Reference:
http://www.c-sharpcorner.com/uploadfile/mahesh/tablelayoutpanel-in-C-Sharp/

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Shailesh21235, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response