Author: sukumarraju | Posted on: 11/12/2009 6:15:02 AM | Views : 473

Hi

Using DetailsView to present single record. DetailsView is displaying data using a method that returns a DataTable.
dvUserRecord.DataSource = MyMethod() dvUserRecord.DataBind();

when the Edit button(out side of DetailsView) is selected, DetailsView enters into Edit mode. Here using a Drop Down List to populate countries data as below.
dvUserRecord_DataBound(object sender, EventArgs e) { if(dvUserRecord.CurrentMode == dvUserRecord.Edit) { DropDownList ddlCountry = dvUserRecord.FindControl("ddlCountry") as DropDownList; if (ddlCountry != null) { //bind data to ddlCountry } } }

All works fine.
Question
Now it is required to populate the above Country drop down list SelectedValue when the DetailsView is in Edit Mode.

In order to achieve this I ha ...

Go to the complete details ...