Ich habe eine gridview
, in dem textbox
dynamisch wollen auf RowDataBound
event.I 3 erzeugt wird, mehr textbox
unter gridview
auf button
Klick zu erzeugen. Hier ist meine gridview Textbox in Gridview auf Knopfdruck erzeugen? ASP.NET C#
Hier mein Code hinter ist:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
string s = Session["num"].ToString();
int num = Int32.Parse(s);
if (e.Row.RowType == DataControlRowType.DataRow)
{
for (int i = 0; i <num; i++)
{
TextBox txt = new TextBox();
txt.Height = 25;
txt.Width = 150;
txt.Font.Size = 10;
txt.ID = "txt" + i;
txt.Text = e.Row.Cells[i].Text.Replace(" ", "");
e.Row.Cells[i].Controls.Add(txt);
}
}
}
Wo ist Ihre Frage oder Problem? – Sami