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...
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);
精彩评论