I have a custom list in my sharepoint 2010 site. I want to set a limit to the list, that after reaching the limit(say 10 items), no one can add any more items to that list. how it can be done.. please tell me how to do it.
Thanks in advance.
I have a custom list in my sharepoint 2010 site. I want to set a limit to the list, that after reaching the limit(say 10 items), no one can add any more items to that list. how it can be done.. please tell me how to do it.
Thanks in advance.
我不认为这可以实现 sharepoint 的 OOTB 功能。
但我可能会使用一些编程
您可以使用事件接收器来实现这一点。
公共覆盖无效项添加(SPItemEventProperties 属性)
{
SPWeb web = properties.OpenWeb();
SPList 列表 = web.Lists[properties.ListId];
if (list.ItemCount == 10)
{
properties.Cancel = true;
}
else
{
base.ItemAdding(properties);
}
}
希望这可以帮助