sharepoint - 如何在 Sharepoint 2010 中过滤未评级的项目

标签 sharepoint listview sharepoint-2010 filtering rating

我在 Sharepoint 2010 中有一个列表,已启用评级并且工作正常。当我将鼠标悬停在评级星星上时,它会向我提供有关我是否已投票以及我的评级的信息。因此,我假设 Sharepoint 将用户信息与评级数据存储在一起。

我想创建一个 ListView ,仅包含当前用户尚未评分的项目。因此,他将能够确保对列表中的每个项目进行投票,而不必突出显示长列表中的每个条目。你能帮我吗?

最佳答案

个人评分信息存储在社交数据库中,并且不与列表项一起存储。列表项仅包含平均评分值和评分数量。您可以创建自定义Web部件并通过类显示当前用户的评分信息型号..

使用以下代码:

using Microsoft.Office.Server.SocialData;    
using Microsoft.Office.Server.UserProfiles;

SPSite oSite = SPContext.Current.Site;
SPServiceContext context = SPServiceContext.GetContext(oSite);
UserProfileManager profileManager = new UserProfileManager(context);
UserProfile profile = profileManager.GetUserProfile(user.LoginName.ToString());
SocialRatingManager socialRatingManager = new SocialRatingManager(context);
socialRatingManager.GetRatings(profile)

关于sharepoint - 如何在 Sharepoint 2010 中过滤未评级的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12912805/

相关文章:

web-services - 使用 SharePoint 的 lists.asmx 和 UpdateListItems 按 Guid 或 UniqueId 删除项目

c# - SharePoint CAML 查询在生成器中有效,但在代码中无效

PowerShell 命令打印值而不是执行

css - 页面上所有内容的 SharePoint 2010 居中和固定宽度,包括功能区

c# - 如何以编程方式将文章页面添加到共享点站点?

sharepoint - SharePoint XSLT扩展功能是否有引用?

android - 动态 ListView 扩展 Activity

Flutter:统计通过ListView.builder创建的item数量并显示

android - ListView 解析波斯语、希腊语、阿拉伯语或 UTF-8 xml

c# - 如何获取 SharePoint 2010 Web 应用程序范围的功能以仅在一个 Web 应用程序上激活