如何更新列表中的查找字段 [英] how to update the look up fields in list
本文介绍了如何更新列表中的查找字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含3个查找字段的列表,我试图通过自定义webpart更新列表项,但只有一个查找字段正在获取更新后的休息字段为空。
这里使用的代码:
Hi,
I have a list that contains 3 lookup fields , i was trying to update the list item through custom webpart, but only one lookup field is getting updated rest fields are empty.
here the code iam using:
SPListItem itms = list.AddItem();
web.AllowUnsafeUpdates = true;
SPFieldLookupValue value1= new SPFieldLookupValue(Convert.ToInt32(row.Cells[0].Text) ,row.Cells[0].Text);
itms["ClientID"] = value1;
SPFieldLookupValue value2=new SPFieldLookupValue(Convert.ToInt32(row.Cells[1].Text), row.Cells[1].Text);
itms["ManagerID"] = value2;
SPFieldLookupValue value3 = new SPFieldLookupValue(Convert.ToInt32(row.Cells[2].Text), row.Cells[2].Text);
itms["RecruiterID"] = value3;
SPFieldLookupValue value4 = new SPFieldLookupValue(Convert.ToInt32(drps.SelectedValue.ToString()), drps.SelectedValue.ToString());
itms["RequirementID"] = value4;
itms.Update();
web.AllowUnsafeUpdates = false;
只有ClientID正在更新
什么可能是请帮忙的原因。
谢谢
Ginnas
only the ClientID is getting updated
what could be the reason please help.
thanks
Ginnas
推荐答案
这篇关于如何更新列表中的查找字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文