覆盖默认控件模板 - ListTitleViewSelectorMenu
我按照此处给出的示例覆盖默认的 DocumentLibraryForm 呈现模板
<SharePoint:RenderingTemplate ID="DocumentLibraryForm" runat="server">
... Custom stuff here ..
</SharePoint:RenderingTemplate>
(这是 2007 版本,2010 版本 相同但不完整,它不显示指令)
而且一切都很好。互联网上还有许多其他覆盖控件呈现模板的示例。
但是,我试图覆盖 ListTitleViewSelectorMenu 等内容,但这不起作用。
<!-- Definition from allitems.aspx -->
<SharePoint:ListTitleViewSelectorMenu AlignToParent="true" id="LTViewSelectorMenu" runat="server" />
I am following the example given here to override the default DocumentLibraryForm rendering template
MSDN - Override a Default Control Template
<SharePoint:RenderingTemplate ID="DocumentLibraryForm" runat="server">
... Custom stuff here ..
</SharePoint:RenderingTemplate>
(Thats the 2007 version, the 2010 version is the same but not complete, it doesn't show the directives)
And that all works just fine. There are lots of other examples on t'internet of overriding control rendering templates.
However I am trying to override things like ListTitleViewSelectorMenu and that isn't working.
<!-- Definition from allitems.aspx -->
<SharePoint:ListTitleViewSelectorMenu AlignToParent="true" id="LTViewSelectorMenu" runat="server" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SharePoint:RenderingTemplate
只能用于覆盖定义的模板,通常在表单和列表视图的生成中。我不认为它们可以用来替换放置在页面布局上的随机控件。我想我已经尝试过您正在尝试做的事情,在列表布局页面上自定义视图下拉列表。我有一个控件显示它已排序。替换控件的方法是使用
DelegateControl
(http://msdn.microsoft.com/en-us/library/ms470880.aspx),但不幸的是ListTitleViewSelectorMenu
是未由标准列表布局中的DelegateControl
包装。您可能需要更换整个面包屑。SharePoint:RenderingTemplate
can only be used to override defined templates, usually in the generation of forms and list views. I dont think they can be used to replace random controls that are placed on page layouts.I think i have tried what you are trying do, customise that view dropdown on list layout pages. I have an control that shows it sorted. The way that you replace controls is with a
DelegateControl
(http://msdn.microsoft.com/en-us/library/ms470880.aspx), but unfortuatelyListTitleViewSelectorMenu
is not wrapped by aDelegateControl
in the standard list layouts. You may have to replace the entire bread crumb.