如何在表格中显示RadioButtonList Print?

时间:2011-08-25 19:39:56

标签: c# .net asp.net visual-studio-2010 radio-button

我已经为此工作了大约两天....我有一个RadioButtonList,后来被替换为PDFB打印的RadioButtonListPrint。当单选按钮不在表格中时,它工作正常,但在表格中,我无法让ListPrint进入表格。任何想法?感谢。

此代码

Control ct;
tempControl = new RadioButtonListPrint();
tempControl.ID = ct.ID + "_print";  
((RadioButtonListPrint)tempControl).CopyRadioButtonListAttributes(((RadioButtonList)ct));
((RadioButtonList)ct).Visible = false;    
ct.Parent.Controls.Add(tempControl);

有这个输出......

enter image description here

1 个答案:

答案 0 :(得分:1)

你必须找到你想要添加的控件(Table),如果你只是将它添加到Container,它将只是你在ControlTree中的最后一个Control:

<强>标记式:

<table>
   <tr>
     <td id="putMeHere" runat="server"></td>
   </tr>
</table>

<强>代码:

HtmlTableCell td = [fill in the container control here].FindControl("putMeHere") as HtmlTableCell; //
td.Controls.Add(tempControl);