我想在单个列中添加一个下拉列表控件。下拉列表值将在表示层上声明
我只想在User_Status
中设置一个保管箱,以便我可以查看状态,当我点击保存按钮时,更改会保存到数据库
<asp:Content ID="Content5" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" DataSourceID="SqlDataSource1" runat="server" BackColor="White" BorderColor="#808080" AutoGenerateColumns="True" AutoGenerateEditButton ="true"
CellPadding="4" ForeColor="Black" GridLines="Vertical"
AllowSorting="True" AllowPaging="True" PageSize="4" >
</asp:GridView>
答案 0 :(得分:0)
这里使用模板字段
<asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="false" DataKeyNames="Id" OnRowDataBound="grdView4_OnRowDataBound" CssClass="Grid table table-hover table-bordered" OnSelectedIndexChanged="GridView4_SelectedIndexChanged">
<Columns>
<asp:TemplateField ItemStyle-Width="20px">
<ItemTemplate>
<asp:DropDownlist runat="server">
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>