hi,
i have creating specific no of dynamic textboxes in gridview. i need to get those textboxes id's and textbox values. here i'm entering textbox values at the runtime, i want to compute those text box values please help me with this...
protected void creategridview()
{
int number = a;
DataTable dt = new DataTable();
dt.Columns.Add("SerialNumber", typeof(string));
dt.Columns.Add("MIN", typeof(string));
dt.Columns.Add("MAX", typeof(string));
dt.Columns.Add("Value", typeof(double));
dt.Columns.Add("Result", typeof(string));
for (int i = 0; i < number; i++)
{
dt.Rows.Add("", "", null);
}
gridview1.DataSource = dt;
gridview1.DataBind();
}
protected void generaterow()
{
this.creategridview();
int numbers = a;
string serialno = b;
string newserialno = serialno.Substring(0, serialno.Length - 1);
int cellcnt = this.gridview1.Rows[0].Cells.Count;
int rowcount = this.gridview1.Rows.Count;
foreach (GridViewRow row in this.gridview1.Rows)
{
Label label1 = new Label();
label1.ID = newserialno + (Convert.ToInt32(row.RowIndex + 1)).ToString();
label1.Text = newserialno + (Convert.ToInt32(row.RowIndex + 1)).ToString();
label1.Attributes.Add("runat", "server");
label1.CssClass = "color";
row.Cells[0].Controls.Add(label1);
Label label2 = new Label();
label2.ID = newserialno + (Convert.ToInt32(row.RowIndex + 1)).ToString();
label2.Text = min.ToString();
label2.Attributes.Add("runat", "server");
label2.CssClass = "color";
row.Cells[1].Controls.Add(label2);
Label label3 = new Label();
label3.ID = newserialno + (Convert.ToInt32(row.RowIndex + 1)).ToString();
label3.Text = max.ToString();
label3.Attributes.Add("runat", "server");
label3.CssClass = "color";
row.Cells[2].Controls.Add(label3);
TextBox textbox1 = new TextBox();
textbox1.ID = newserialno + (Convert.ToInt32(row.RowIndex + 1)).ToString();
textbox1.Attributes.Add("runat", "server");
row.Cells[3].Controls.Add(textbox1);
Label label4 = new Label();
label4.ID = newserialno + (Convert.ToInt32(row.RowIndex + 1)).ToString();
label4.Attributes.Add("runat", "server");
label4.CssClass = "color";
row.Cells[4].Controls.Add(label4);
}
}
here i created 3 labels and 1 textbox for each row in gridview. i need to add those textbox values...
so how do i get values in textboxes please tell me...
thank you...