开发者

How do I display RadioButtonListPrint in a table?

I have been working on this for about two days....I have a RadioButtonList that later gets replaced with a RadioButtonListPrint for pdf print. It works fine when the radio button is not in a table, but when in a table I am unable to get the ListPrint to go in the table. Any ides? Thanks.

This code

Control ct;
tempControl = new RadioButtonListPrint();
tempControl.ID = ct.ID + "_print";  
((RadioButtonListPrint)tempControl).CopyRad开发者_JAVA百科ioButtonListAttributes(((RadioButtonList)ct));
((RadioButtonList)ct).Visible = false;    
ct.Parent.Controls.Add(tempControl);

has this output...

How do I display RadioButtonListPrint in a table?


You have to find the control(Table) you want to add to, if you just add it to the Container it will just be last Control in the ControlTree as you are seeing:

Mark-up:

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

Code:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜