Click here to Skip to main content
15,906,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am Binding table to dropdownlist with datasource property and displaying
records in gridview.
I want to display selected record in grid to respective fields in page
It works fine with Textfield but gives error with dropdownlist
error:'DropDownList' has a SelectedValue which is invalid because it does not exist in the list of items'
C#
//Combo();
       int id  = Convert.ToInt32(((Label)gvEmp.SelectedRow.Cells[1].FindControl("lblId")).Text) ;
       txtName.Text= ((Label)gvEmp.SelectedRow.Cells[2].FindControl("lblName")).Text;
       string desig;
       desig = gvEmp.SelectedRow.Cells[3].Text.ToString();
       ddlDesig.ClearSelection();
       ddlDesig.Text = desig;


answer appreciated
Posted
Updated 16-Aug-10 1:40am
v3

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900