关于用Table做DataGrid里模版列,ID的问题
请问下,我在DataGrid里模版列
<ItemTemplate>
<asp:Table id="Table1" runat="server" Width="520px" GridLines="Both" HorizontalAlign="Center"></asp:Table>
</ItemTemplate>
我在DataGrid的 ItemDataBound 事件中处理Table
TableRow tRow = new TableRow();
Table2.Rows.Add(tRow);
TableCell tCell = new TableCell();
tCell.Text="ghghh";
tRow.Cells.Add(tCell);
它说找不到Table2的类空间,我该怎么办?
高手给代码
<ItemTemplate>
<asp:Table id="Table1" runat="server" Width="520px" GridLines="Both" HorizontalAlign="Center"></asp:Table>
</ItemTemplate>
我在DataGrid的 ItemDataBound 事件中处理Table
TableRow tRow = new TableRow();
Table2.Rows.Add(tRow);
TableCell tCell = new TableCell();
tCell.Text="ghghh";
tRow.Cells.Add(tCell);
它说找不到Table2的类空间,我该怎么办?
高手给代码
...全文
请发表友善的回复…
发表回复
jxufewbt 2005-11-30
- 打赏
- 举报
<ItemTemplate>
<asp:Table id="Table1" runat="server" Width="520px" GridLines="Both" HorizontalAlign="Center"></asp:Table>
</ItemTemplate>
Table Table2=(Table)e.Item.FindControl("Table1");
TableRow tRow = new TableRow();
Table2.Rows.Add(tRow);
TableCell tCell = new TableCell();
tCell.Text="ghghh";
tRow.Cells.Add(tCell);
<asp:Table id="Table1" runat="server" Width="520px" GridLines="Both" HorizontalAlign="Center"></asp:Table>
</ItemTemplate>
Table Table2=(Table)e.Item.FindControl("Table1");
TableRow tRow = new TableRow();
Table2.Rows.Add(tRow);
TableCell tCell = new TableCell();
tCell.Text="ghghh";
tRow.Cells.Add(tCell);
呆呆辉 2005-11-30
- 打赏
- 举报
我不知到在后台怎么定义啊。
在后台new Table是肯定不行的啊
在后台new Table是肯定不行的啊
Baby_Happy 2005-11-30
- 打赏
- 举报
没有定义Table2吧
可能要实例化
学习
可能要实例化
学习