是否可以通过编程方式将共享点列表视图创建为甘特图视图?我以编程方式创建了列表视图,请参阅下面的代码
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();