The situation is the following. I'm creating an XsltListViewWebPart during the Page LifeCycle which is added to the page Controls collection (or UserControl Controls collection). The XsltListViewWebPart is displayed as expected. The only problem is that when an item is selected, the "List Tools" ribbon tab is not available (not visible).
XsltListViewWebPart lvwp = new XsltListViewWebPart(); SPWeb thisWeb = SPContext.Current.Web; SPList list = thisWeb.GetList(SPUtility.ConcatUrls(thisWeb.ServerRelativeUrl, "lists/" + listName)); SPView view = list.DefaultView; lvwp.ListId = list.ID; lvwp.ViewGuid = tabView.ID.ToString("B").ToUpperInvariant(); lvwp.ItemContext = SPContext.GetContext(this.Context, view.ID, list.ID, thisWeb); lvwp.ShowToolbarWithRibbon = true; this.Controls.Add(lvwp);
What am I missing?