I have a DropDownList in GridView. During the edit action, DropDownLists in all the rows work properly on editing (and updating).
But in certain rows, when I click edit button, it displays the following error:
'DropDownList3' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value
This is the code:
<asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="AccessDataSource4"
DataTextField="ProvinceName" DataValueField="ProvinceName" SelectedValue='<%# Bind("Province") %>'>
</asp:DropDownList>
Table "RateCenters" is displayed in the Gridview, which has "Province Column". Province column gets the source from the "ProvinceName" of the Table ProvinceList.
Kindly let me know the solution.
DropDownListmarkup.