Santhosh K S

Santhosh K S

  • NA
  • 34
  • 46.4k

Error 'drdpStatusType' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value

Jun 6 2012 4:30 AM
Hi..........
  
Im using dropdownlist in Gridview,manualy i'm adding list element to dropdown list,
the code is  as in below. when i compile i'm getting error like this....
" 'drdpStatusType' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value"


please send how to fix this
thanks in advance...........

 <asp:TemplateField HeaderText="StatusType" SortExpression="StatusType">
                                    <EditItemTemplate>
                                       <asp:DropDownList ID="drdpStatus"  runat="server"  AutoPostBack="false" 
                                           DataTextField="StatusType"  DataValueField="StatusType"  SelectedValue='<%# Bind("StatusType") %>' AppendDataBoundItems="True">
                                          <asp:ListItem >InProgress</asp:ListItem>
                                          <asp:ListItem >Complete</asp:ListItem> </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("StatusType") %>' ></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

Answers (1)