0

I have an error like below. I have inserted only the SharePoint drop down control alone in my application while clicking save it throws this error

SharePoint drop down control:

<SharePoint:DVDropDownList  ID="ddl_Application" CssClass="form-control" runat="server" ></SharePoint:DVDropDownList>

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

I don't know what i did wrong kindly help me to resolve this,Thanks in advance

0

In your case "Source" doesn't return any values. So it can't set a value for SelectedIndex because there is nothing to select.

Check your list if there are any entries.

  • i didn't bind any values for the controls just added the empty controls alone for that itself it throws exception – Hariprasad Nagendren Sep 20 '17 at 10:18
  • I didn't use list and nothing just a drop down control only while click save it throws the above error i didn't made anything with that control its empty – Hariprasad Nagendren Sep 20 '17 at 11:14
  • This sol. sets AppendDataBoundItems="true" on the DropDownList & creates one nullable ListItem so that your DropDownList will bind even when the field in the table is null. The following snippet would provide n option that would be selected when the Application field is null. <SharePoint:DropDownList ID="ddl_Application" runat="server" DataSourceID="SubjectDataSource" DataTextField="fullname" DataValueField="empl_Id" SelectedValue='<%# Bind("Application") %>' AppendDataBoundItems="true"> <asp:ListItem Text="Select" Value="" />< </SharePoint:DropDownList> – Swapnil Sep 20 '17 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.