Loading
  1.     Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs)
  2.         Dim strCurrentCountryName = "United Kingdom"
  3.         Dim ddl As DropDownList = CType(DetailsViewCompany.FindControl("DropDownListCountry"), DropDownList)
  4.         ddl.Items.FindByText(strCurrentCountryName).Selected = True
  5.         ' Code above goes here
  6.     End Sub

Comments

You will see I am forcing strCurrentCountryName to contain a value, just for debug/testing purposes.

Rich • 08 Jul 2016, 14:28:14 UTC