2011-08-25 8 views
1

약 2 일 동안이 작업을 해왔습니다. 나중에 RadioButtonList를 사용하여 PDF 인쇄용 RadioButtonListPrint로 대체했습니다. 라디오 버튼이 테이블에 없지만 테이블에있을 때 ListPrint를 테이블에 넣을 수 없으면 잘 작동합니다. 어떤 ides? 감사.RadioButtonListPrint를 테이블에 표시하려면 어떻게합니까?

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

당신은 제어 (표) 당신이 단지에 추가하는 경우에 추가 할 찾을 수있다 콘테이너 그것은 당신이보고있는대로 ControlTree의 마지막 컨트롤 일 것입니다 :

마크 업 :

<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); 
+0

감사합니다. 나는 runat = aspx 페이지에서 "server"가 누락되었습니다. – MrM

관련 문제