我是把数据库里的数据绑入gridview中,现在需要其中某列的单元格显示为下拉框的形式,而不是默认的textbox格式?
怎么做???

解决方案 »

  1.   

    参见
    http://dotnet.aspx.cc/file/Add-Delete-Update-Edit-Data-With-Paging-in-GridView.aspx
        <ItemTemplate>        <asp:DropDownList ID="uClassName" runat="server">
              <asp:ListItem Text="小学" Value="小学"></asp:ListItem>
              <asp:ListItem Text="中学" Value="中学"></asp:ListItem>
              <asp:ListItem Text="高中" Value="高中"></asp:ListItem>
              <asp:ListItem Text="大学" Value="大学"></asp:ListItem>
            </asp:DropDownList>
          </ItemTemplate>
      

  2.   

       <asp:TemplateField HeaderText="角色">
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddpRole" runat="server">
                        <asp:ListItem Value="0">--角色--</asp:ListItem>
                        <asp:ListItem Value="2" >高级管理员</asp:ListItem>
                        <asp:ListItem Value="3" >项目管理员</asp:ListItem>
                       </asp:DropDownList>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("rname") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>是这个意思吧
      

  3.   

    明白了;
    楼主这样;
    http://hi.csdn.net/space-10148426-do-album-picid-1041877.html
      

  4.   

    呃,我用的是WINFORM,那些代码我看不懂
    呜呜,我要继续加油啦。