I have write a custom field that extends SPFieldLookup. I set AllowMultipleValues = true; Here is Field Control Value:
public override object Value
{
get
{
EnsureChildControls();
SPFieldLookupValueCollection vals = new SPFieldLookupValueCollection();
ICollection s = TinBaiLienQuanPicker.SelectedIds;
if (s != null && s.Count > 0)
{
foreach (var i in s)
{
ListItem z = availableItems.Find(x => (x.Value == i.ToString()));
if (z != null)
{
vals.Add(new SPFieldLookupValue(int.Parse(z.Value), z.Text));
}
}
}
return vals;
}
set
{
EnsureChildControls();
base.Value = value as SPFieldLookupValueCollection;
}
}
When control save field data, I see it return a collection which have multiple value. But when I retrieve data again, I receive only the first value. I get value from Control Field ' ListItemFieldValue property.
Please give me a tip. Thank you very much.