Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
protected void Button1_Click(object sender, EventArgs e)
{





if (txtQuantity.Text != "")
{
for (int i =0; i < Convert.ToInt16(txtQuantity.Text);i++ )
{


Label la = new Label();
la.Text = ddlProductName.SelectedItem.Value + i.ToString();
la.ID = "abc" +i;

PlaceHolder1.Controls.Add(la);

//la = FindControl(String.Format(i)) as Label;




TextBox txtbox = new TextBox();
// txtbox.Text = "Textbox - " + i.ToString();


PlaceHolder1.Controls.Add(new LiteralControl("<input id='txt' name='Textbox" + i + "'type='text' />"));
PlaceHolder1.Controls.Add(new LiteralControl("
"));

}
}


}
Hi Everyone,
This is my code. How will i split the dynamically generated textboxes in gridview into two columns.
Posted
Comments
Sergey Alexandrovich Kryukov 16-Apr-14 2:33am    
Bad idea. Why not using something like table (grid view) with two columns?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900