2

Using SharePoint Designer 2013 I've created a Data View web part that links to a Task List on my SharePoint 2013 site - and it all works as I'd expect.

The only thing I can't seem to do is to remove the timeline...

When I look at the Web Part properties within SharePoint Designer there is no option for the timeline so I can't hide it from there and I can't seem to find any other way to hide it via the code.

Can anybody help?

7
  1. Navigate to the Task List and (in the ribbon) click on 'List' -> 'Modify View'.
  2. In the view settings page that opens up, scroll down near the bottom of the page and expand the 'Style' section.
  3. On the right, UNDER the View Style selection box that appears, there is a check box labeled 'Show timeline above the view'. Un-check this check box then click the 'OK' button.
2

If you are in the advanced edit mode in the designer you can change the WebPart XML:

<WebPartPages:XsltListViewWebPart runat="server" ShowTimelineIfAvailable="False">

The ShowTimelineIfAvailable Attribute will hide the timeline when you set it to false

  • This works for the first time but then somehow Sharepoint Designer removes this attribute and the timeline re-appears. So I really wonder what exactly does the "Show timeline" checkbox change and where. – DmytroL Mar 23 '16 at 15:05
1

I'm not sure if it can be done with code. You can edit the properties of the web part in the browser, and deselect the Timeline option there, but the option is not available in the properties window in Designer.

enter image description here

  • Thanks, if I could edit the web parts on the page I am creating this may be a solution but I'm not able to as I don't get the option. Maybe I need to go back to the drawing board and look at how I've created the page in the first place! – TonyR Apr 16 '14 at 12:30
  • I tried comparing the markup when the timeline is disabled, and when it's enabled, but I could not find any differences. – wjervis Apr 16 '14 at 12:35
0

I think I found the answer. I'd created the page as a 'non-webpart' page. When I created a webpart page I was able to add the webpart and then amend it according.

0

Navigate to the Task List and (in the ribbon) click on 'List' -> 'Modify View'. In the view settings page that opens up, scroll down near the bottom of the page and expand the 'Style' section. On the right, UNDER the View Style selection box that appears, there is a check box labeled 'Show timeline above the view'. Uncheck this check box then click the 'OK' button.

  • Could you elaborate on the answer a little to help the OP more? Thanx – Benny Skogberg Dec 24 '14 at 5:12
0

I've found a way to remove timeline through code.

Code first:

var spView = myList.Views.Cast<SPView>().FirstOrDefault(v => v.Title == "ViewToManipulate");

if (spView != null)
{
    // remove timeline. yep. 
    spView.ViewData = spView.ViewData.Replace(@"<FieldRef Name=""DueDate"" Type=""TimelineDueDate"" />",string.Empty);
    spView.Update();
}

Explain the magic

A 'clean' view will have the following ViewData

<ViewData>
    <FieldRef Name="PercentComplete" Type="StrikeThroughPercentComplete" />
    <FieldRef Name="DueDate" Type="TimelineDueDate" />
</ViewData>

Modified view will have the following ViewData

<ViewData>
    <FieldRef Name="PercentComplete" Type="StrikeThroughPercentComplete" />
</ViewData>

How I found it:

I've used ErwinHernandez answer, and then compared the ViewData property.

0

You can hide the timeline in SharePoint 2013/2016 task lists by following below steps-

  1. Go to the Task List, Click on List Tab and then click on "Modify View" button from the ribbon.
  2. In the Edit view page, scroll down and expand the 'Style' section.
  3. Under the Style selection, Uncheck the checkbox 'Show timeline above the view
  4. click on 'OK' button to save changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.