20 เมษายน 2555 5:47
How do I ensure that the Project task list of SharePoint 2010 displays in Gantt view when used in a web part?
I have a site with a Project Task List, which has a custom Gantt view as the default view. The home page of the site, which is not a wiki page, has a List View Web Part for the Task List where the Gantt view is selected but the the list is not showing in Gantt view and instead showing an standard view which is not required.
When you drop the Project task list on the page as a web part, it should be showing the gantt view since it is the default view but it is still showing as the standard view.We have also verified it from the code by getting the ViewGuid of the currently selected view to ensure that the correct view is being selected and the view selected is the correct one but not showing the Gantt chart.
if (WebPartWPQ2_JSGridController == null)
WebPartWPQ2_JSGridController = new SP.GanttControl();
WebPartWPQ2_JSGridController.Init(new SP.JsGrid.JsGridControl($get('ListViewWebPartJSGrid'), true),
The above code is creating a JSGrid control which is showing the gantt view but why is it not showing the gantt view without editing the webpart.
Kindly let me know if any one has some idea regarding this issue.