在表标签中显示arraylist [英] display arraylist in table tag
本文介绍了在表标签中显示arraylist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个arraylist.我在
hi guys,
i have an arraylist. i have a , under
推荐答案
检查此
Hi ,
Check this
<div>
<asp:Table ID="Table1" runat="server">
</asp:Table>
</div>
protected void Page_Load(object sender, EventArgs e)
{
string[] test = new string[] { "test", "test2", "test3", "test4" };
foreach (string item in test)
{
TableRow tr = new TableRow();
TableCell tc = new TableCell();
tc.Text = item;
tr.Controls.Add(tc);
Table1.Controls.Add(tr);
}
}
最好的问候
M.Mitwalli
Best regards
M.Mitwalli
没有收到您的问题,您究竟在寻找什么...
但是,如果我没记错的话,以下是您的解决方案
Did not get your question what exactly you are looking for…
But if I am not wrong, following is your solution
Public void ReadArrayList(ArrayList list)
{
foreach (int i in list)
{
Console.WriteLine(i);
}
}
或
OR
foreach (ArrayList item in arrList)
{
Fields["KOD"].Value = item[0];
Fields["DESC"].Value = item[7];
Fields["QTY"].Value = Convert.ToInt32(item[1]);
Fields["PRICE"].Value = Convert.ToDouble(item[3]);
...
}
这篇关于在表标签中显示arraylist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文