yes, write a EditItemTemplate, seehttp://www.4guysfromrolla.com/webtech/050801-1.shtml

解决方案 »

  1.   

    to saucer(思归/MVP):  你误会我的意思了,我的意思是,在同一列里,根据不同的情况,有时候载入DropDownList,有时候载入TextBox,这样怎么实现?
      

  2.   

    <asp:TemplateColumn>
      <ItemTemplate>
           <asp:TextBox id=tb runat=server Visible='<%# (int)DataBinder.Eval(Container.DataItem,"SomeColumn") == 1 %>' />      <asp:DropDownList id=ddl runat=server Visible='<%# (int)DataBinder.Eval(Container.DataItem,"SomeColumn") == 0 %>' />
      </ItemTemplate>
    </asp:TemplateColumn>or you can always do it inside ItemCreated event handler