table 动态加载,遍历子控件
来源:互联网 发布:王者荣耀墨子知乎 编辑:程序博客网 时间:2024/06/05 02:56
<div id="DIV1" runat="server">
<asp:Panel ID="panel1" runat="server">
</asp:Panel>
<asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Button" />
<asp:TextBox ID="TextBox9" runat="server"></asp:TextBox>
</div>
protected void Page_Load(object sender, EventArgs e)
{
Table table = new Table();
panel1.Controls.Add(table);
table.BorderWidth = 2;
TableRow tr1 = new TableRow();
TableRow tr2 = new TableRow();
table.Rows.Add(tr1);
table.Rows.Add(tr2);
for (int i = 0; i < 3; i++)
{
TableCell tc1 = new TableCell();
TableCell tc2 = new TableCell();
tr1.Cells.Add(tc1);
tr2.Cells.Add(tc2);
TextBox textbox = new TextBox();
Label lab = new Label();
tc1.Controls.Add(lab);
tc2.Controls.Add(textbox);
lab.Text = " ghfg";
textbox.Width = 80;
string textboxID = "textbox" + i;
textbox.ID = textboxID;
}
}
protected void Button3_Click(object sender, EventArgs e)
{
Table table = panel1.Controls[1] as Table;
foreach (TableRow row in table.Rows)
{
foreach (TableCell cell in row.Cells)
{
foreach (Control control in cell.Controls)
{
if (control is TextBox)
{
TextBox9.Text += ((TextBox)control).Text;
}
}
}
}
}
- table 动态加载,遍历子控件
- 递归遍历UI/遍历控件/动态加载UI
- 加载table控件
- 遍历RibbonControl子控件
- 遍历查找子控件
- MFC遍历子控件
- 动态创建子控件
- 动态添加子控件
- bootstrap table动态加载数据
- 遍历对话框中的子控件
- 动态的加载控件
- 动态加载用户控件
- 如何动态加载控件?
- 动态加载控件问题
- 动态加载用户控件
- 动态加载自定义控件
- SilverLight动态加载控件
- 动态加载用户控件
- ibatis js 分页
- 对spring mvc的配置文件的小小明白
- 系统工具
- java程序设计—略析
- 字符串编码转换
- table 动态加载,遍历子控件
- 是
- gdb常用命令
- JAVA的list,set,数组之间的转换
- Google Maps API V3学习一(获取地图坐标与街道地址)
- MyEclipse使用方便设置
- 升级Red Hat 9.0(Kernel 2.4.20-8) 至 Linux Kernel 2.6.15 笔记(最全)
- FLEX 小数点
- maven的基础入门