Showing me error : DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Jul 16, 2013, 7:56 AM
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
Sanjeeb LenkaPosted Jul 16, 2013, 7:25 AM
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