问题描述
HI专家我有一个包含3行和3列的数据表。我想要将它绑定到webform中。 Lable可以动态填充。请指导我。
以下是我以前的代码。但它对我不起作用。
TableRow tr = new TableRow();
tr.ID =tr+ count;
tc.ID =tc+ tablecellid;
lbl.ID =ID+ tablecellid;
lbl.Text = dtfinal。行[i] [TEXT]。ToString();
tablecellid = tablecellid + 1;
tc.ID =tc+ tablecellid;
lbl.ID =ID+ tablecellid;
lbl.Text = dtfinal.Rows [i] [DESC]。ToString();
count = count + 1;
tablecellid = tablecellid + 1;
tc.Controls.Add(lbl);
tr.Cells.Add (tc);
Table1.Rows.Add(tr);
Rgds
Jagadesh
HI EXPERTS
I had a datatable which contains 3rows and 3 columns. I want this to be bind in a lable into the webform. Lable to be populate Dynamically. Kindly guide me.
Below is the code i used to do. But it is not working for me.
TableRow tr = new TableRow();
tr.ID = "tr" + count;
tc.ID = "tc" + tablecellid;
lbl.ID = "ID" + tablecellid;
lbl.Text = dtfinal.Rows[i]["TEXT"].ToString();
tablecellid = tablecellid + 1;
tc.ID = "tc" + tablecellid;
lbl.ID = "ID" + tablecellid;
lbl.Text = dtfinal.Rows[i]["DESC"].ToString();
count = count + 1;
tablecellid = tablecellid + 1;
tc.Controls.Add(lbl);
tr.Cells.Add(tc);
Table1.Rows.Add(tr);
Rgds
Jagadesh
这篇关于填充标准的dyanamically的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!