Bind lookup field data to the dropdownlist
if (spListItem["LookupField"]
!= null)
{
SPFieldLookupValue spv = new
SPFieldLookupValue(spListItem["LookupField"].ToString());
string lookupValue = spv.LookupValue;
dropdownlist1.SelectedIndex
= spv.LookupId;
}
|
To bind field values to the dropdownlist:
dropdownlist1.SelectedValue = spListItem["Field1"].ToString();
|