Save unbound dropdownlist data
-
Hi folks, I have add a dropdownlist into my datagridview. This dropdown list consists two unbound value (item1= 'YES' and item2= 'NO') How can I update my datagridview data by using update button. Any idea? error message is: "DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items"
-
Hi folks, I have add a dropdownlist into my datagridview. This dropdown list consists two unbound value (item1= 'YES' and item2= 'NO') How can I update my datagridview data by using update button. Any idea? error message is: "DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items"
Try to create a list of items, hard coded ( just a List<string> will do ), and then bind to that.
Christian Graus Driven to the arms of OSX by Vista.
-
Try to create a list of items, hard coded ( just a List<string> will do ), and then bind to that.
Christian Graus Driven to the arms of OSX by Vista.
Thanks for your reply.. I have added the following code and no change occured: <asp:TemplateField HeaderText="EAN" SortExpression="EAN"> <EditItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server" DataTextField="EAN" DataValueField="EAN" > <asp:ListItem Text="YES" Value="YES" /> <asp:ListItem Text="NO" Value="NO" /> </asp:DropDownList> </EditItemTemplate>
-
Try to create a list of items, hard coded ( just a List<string> will do ), and then bind to that.
Christian Graus Driven to the arms of OSX by Vista.
Hello, Thank you for your reply. I have added the following code but nothing changed: <asp:TemplateField HeaderText="EAN" SortExpression="EAN"> <EditItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server" DataTextField="EAN" DataValueField="EAN" > <asp:ListItem Text="YES" Value="YES" /> <asp:ListItem Text="NO" Value="NO" /> </asp:DropDownList> </EditItemTemplate>