What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 16643 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > C# > Dynamic Table creation in C# ...
Arul44ece

Dynamic Table creation in C#

 Code Snippet posted by: Arul44ece | Posted on: 10/11/2012 | Category: C# Codes | Views: 598 | Status: [Member] | Points: 40 | Alert Moderator   


The below code used to create text box and table dynamically.

Table tb = new Table();


tb.BorderWidth = Unit.Pixel(5);

for (int i = 1; i <= Convert.ToInt32(TextBox1.Text ); i++)

{

TableRow tr = new TableRow();

for (int j = 1; j <= 3; j++)

{

TableCell td = new TableCell();

TextBox c_text = new TextBox();

c_text.Visible = true;

c_text.Text = "R"+i.ToString()+j.ToString();

c_text.ID = "R" + i.ToString() + j.ToString();

td.Controls.Add(c_text);

tr.Cells.Add(td);

tb.Rows.Add(tr);

form1.Controls.Add(tb);

}

}


Regards,

Arul R
arul44.ece@gmail.com
Found interesting? Add this to:


 Responses

T.Saravanan
Posted by: T.Saravanan | Posted on: 10/4/2012 | Level: Silver | Status: [Member] [MVP] | Points: 10 | Alert Moderator 

Kindly post your code inside the code tag.

Thanks,
T.Saravanan

>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/23/2013 1:28:12 PM