看看这样能不能解决你的问题。<asp:TemplateColumn>
<HeaderTemplate>
门票种类
</HeaderTemplate>
<EditItemTemplate>
<asp:DropDownList Runat="server" ID="DownListTypeID"></asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:label runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "TypeID")%>' ID="Label1"/>
</ItemTemplate>
<FooterTemplate>
<asp:linkbutton runat="server" id="btnNewRow" CausesValidation=False onclick="AddNewRow" Enabled='<%# IsLastPage() %>' Text="添加新行" />
</FooterTemplate>
</asp:TemplateColumn>

解决方案 »

  1.   

    可以添加,引用时要使用findcontrol方法
      

  2.   

    在模版中使用的服务端控件,系统是不会自动定义的,手动添加定义后,在使用时系统会报
    --------不要添加定义,如果你要是想用这个服务器控件
    要通过this.DataList.Item[i].FindControl("你的控件ID")
      

  3.   

    用findcontrol确实可以找到我的控件,但是另外还有一个问题,就是我的控件是checkbox,我想利用它的checked属性来选定它,可是findcontrol后面没有这个属性。
      

  4.   

    你可以转化呀
    CheckBox cb = (CheckBox)this.DataList.Item[i].FindControl("你的控件ID");
    if(cb.Checked)
    {}
    else
    {}