是否可以通过编程方式将共享点列表视图创建为甘特图视图?
是否可以通过编程方式将共享点列表视图创建为甘特图视图?我以编程方式创建了列表视图,参考下面的代码
var web = (SPWeb)properties.Feature.Parent;
SPList list = web.GetList(SharedDocumentListUrl);
SPViewCollection allviews = list.Views;
string viewName = "Document Review Summary";
System.Collections.Specialized.StringCollection viewFields = new System.Collections.Specialized.StringCollection();
viewFields.Add(EYWorkProductIndicator);
viewFields.Add(EYPaperProfile);
viewFields.Add(DocIcon);
string myquery = "<Where><Eq><FieldRef Name='Status' /><Value Type='Choice'>In Review</Value></Eq></Where>"
+ "<OrderBy><FieldRef Name='LinkFilename' Ascending='True' /></OrderBy>";
SPView customView = allviews.Add(viewName, viewFields, myquery, 100, true, false);
customView.XslLink = "eymain.xsl";
customView.Update();
Is that possible to create sharepoint list view as gant chart view programically? I created list view programically refer below code
var web = (SPWeb)properties.Feature.Parent;
SPList list = web.GetList(SharedDocumentListUrl);
SPViewCollection allviews = list.Views;
string viewName = "Document Review Summary";
System.Collections.Specialized.StringCollection viewFields = new System.Collections.Specialized.StringCollection();
viewFields.Add(EYWorkProductIndicator);
viewFields.Add(EYPaperProfile);
viewFields.Add(DocIcon);
string myquery = "<Where><Eq><FieldRef Name='Status' /><Value Type='Choice'>In Review</Value></Eq></Where>"
+ "<OrderBy><FieldRef Name='LinkFilename' Ascending='True' /></OrderBy>";
SPView customView = allviews.Add(viewName, viewFields, myquery, 100, true, false);
customView.XslLink = "eymain.xsl";
customView.Update();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您与这里所拥有的非常接近。在将视图添加到 SPViewCollection 的行中,您需要使用不同的重载方法。方法选项列表位于此处。您需要包含 SPViewCollection.SPViewType 类型的类型。这条线应该看起来像这样。
You are pretty close with what you have here. In your line where you add the view to the SPViewCollection, you need to use a different overload method. The list of method options is here. You need the one that includes the SPViewCollection.SPViewType type. This line should look something like this.