SPGridView - 用户选择列
有没有办法在 Web 部件中扩展 SPGridView 控件,以便用户可以选择他们想要显示的列?有点像创建/修改列表视图时?
谢谢
Is there a way to extend the SPGridView control in a webpart such that a user can select the columns that they want to display? Kinda like when creating/modifying a view for a list?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SPGridView 未密封< /strong> 所以当然可以用这个功能来扩展它。您需要针对用户选择的内容构建自己的数据存储(SharePoint 列表就足够了),进行 UI 修改等。
在尝试扩展提供的 SharePoint 控件时我发现的一件事是,即使大多数控件都不是“它们不是密封的,通常也不是为了扩展而设计的。在某些情况下,成员也会被混淆,这在某些情况下可能会终止扩展计划。
在投入这项开发之前,请确保您通过一些快速的概念证明尽可能多地研究这一点。您可能会发现有必要从头开始编写自己的控件(或者找到另一个提供此功能的标准 ASP.NET 控件并将其连接到 SharePoint 数据源)。
SPGridView is not sealed so certainly it can be extended with this functionality. You would need to build your own data store of what users have chosen (a SharePoint list should suffice), make the UI modifications, etc.
One thing I've found when trying to extend the provided SharePoint controls is that even though most aren't sealed, often they aren't designed to be extended either. In some cases the members are obfuscated as well which in some cases can put an end to extension plans.
Make sure you research this as much as possible with some quick proof of concepts before devoting to this development. You may find it's necessary to write your own control from scratch (or find another standard ASP.NET control that provides this functionality and hook it up to a SharePoint data source).