Showing me error : DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items
Getting problem in gridview EditItemTemplate
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 16, 2013, 3:25 AM EDT
you have to bind the dropdown in gridview RowDataBound event:
Refer to this link:
http://www.aspsnippets.com/Articles/Populate-DropDownList-with-Selected-Value-in-EditItemTemplate-of-GridView-in-ASPNet.aspx
any problem reply
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 16, 2013, 3:56 AM EDT
Try like this
in your aspx
in your code, you need assign on row editing
HiddenField hdnfld=(HiddenField )GridView.Rows[e.NewEditIndex].FindControl("HdnGender");
Regards,
Iftikar