我有一个 SharepointList
列表名称:RegionList
字段:(regId number
Regname Choice
复选框:允许多选)
Choice 字段项显示在 CheckBoxList 项中。我将这些项目保存为带有逗号分隔值的字符串。
protected string GetSelectedRegions()
{
List<String> regList = new List<string>();
// Loop through each item.
foreach (ListItem item in chkRegion.Items)
{
if (item.Selected)
{
// If the item is selected, add the value to the list.
regList.Add(item.Value);
}
else
{
// Item is not selected, do something else.
}
}
String regs = String.Join(",", regList.ToArray());
return regs;
}
从上面的代码中,regs
参数具有选定项目的数量并保存到列表中。现在,问题是当我打开列表并以Edit
模式打开记录时CHOICE Field Doesn't Show any Selected ITEM. But, when i send only single value then it Show the Selected Item that was saved.
任何的想法? 请让我知道如何将 CheckBoxList 项目存储到 CHOICE 字段并检索它。提前致谢!