Hi,
I have a gridview with dropdown control. I need to save dropdown selected value to another sharepoint list's Lookup column field.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Brijendra GautamRank #1,900 · 778 reputationPosted Mar 14, 2014, 12:44 AM EDT
foreach (GridViewRow gr in spGrid.Rows)
{
DropDownList ddlLookup = (DropDownList)gr.FindControl("ddlLookup");
SPListItem listItem = splist.Items.Add();
SPFieldLookupValue lookup = new SPFieldLookupValue(Convert.ToInt32( ddlLookup.SelectedItem.Value), ddlLookup.SelectedItem.Text);
listItem["lookup"] = lookup;
listItem.Update();
}