我有以下代码。这样,下拉列表在datagridview中有4个set选项。我也有很少的可编辑列。我正在努力实现以下目标:
我是新来的,因此需要很多支持。
提前致谢。
<asp:TemplateField HeaderText="Action Requested" ItemStyle-HorizontalAlign="left" ItemStyle-VerticalAlign="Middle">
<ItemStyle Wrap="False" />
<HeaderStyle BackColor="black" ForeColor="White" Font-Bold="true" Font-Size="Large"/>
<ItemTemplate>
<asp:dropdownlist ID="ddl_Validation" runat="server" AutoPostBack="true" OnSelectedIndexChanged="GV_Sec_Validation_SelectedIndexChanged">
<asp:ListItem Text="Select a value" Value="aaaa"/>
<asp:ListItem Text="BBBB" Value="bbbb"/>
<asp:ListItem Text="CCCC" Value="cccc"/>
<asp:ListItem Text="DDDD" Value="dddd"/>
<asp:ListItem Text="EEEE" Value="eeee"/>
</asp:dropdownlist>
<asp:ImageButton ID="IbtnSave" ImageUrl="~/Images/save.png" runat="server" CommandName="Save" ToolTip="Save" Width="10px" Height="10px" Visible="false" />
<asp:ImageButton ID="IbtnEdit" ImageUrl="~/Images/edit.png" runat="server" CommandName="Edit" ToolTip="Edit" Width="10px" Height="10px" Visible="false" />
<asp:ImageButton ID="IbtnCancel" ImageUrl="~/Images/cancel.png" runat="server" CommandName="Cancel" ToolTip="Cancel" Width="10px" Height="10px" Visible="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SR" ControlStyle-Width="30px" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
<ItemTemplate>
<asp:Label ID="lblDomain_SR" Text='<%# Eval("SR") %>' runat="server" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtDomain_SR" Text='<%# Eval("SR") %>' runat="server" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CD" ControlStyle-Width="30px" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
<ItemTemplate>
<asp:Label ID="lblDomain_CD" Text='<%# Eval("CD") %>' runat="server" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtDomain_CD" Text='<%# Eval("CD") %>' runat="server" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DI" ControlStyle-Width="30px" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
<ItemTemplate>
<asp:Label ID="lblDomain_DI" Text='<%# Eval("DI") %>' runat="server" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtDomain_DI" Text='<%# Eval("DI") %>' runat="server" />
</EditItemTemplate>
</asp:TemplateField>
&#13;