SIGN UP MEMBER LOGIN:    
ARTICLE

Adding Scrollbar in SharePoint list Web Part and customizing look and feel

Posted by Vivek Srivastava Articles | SharePoint March 26, 2011
Learn how to add a scrollbar in a SharePoint list Web Part and customize the look and feel of a SharePoint List web part.
Reader Level:

In this article I will explain how we can customize the look and feel of a SharePoint List web part.

Step 1: Adding a List Web Part to a SharePoint page.

  • Open SharePoint; click on site action tab and select edit page.

    Scrollbar1.gif 

     

  • Now the Default .aspx page will be open in edit mode.
     

  • Click on web part zone to add list web part.

    Scrollbar2.gif 

     

  • Now web part window will be open, select Tasks web part from the List and Libraries section and click on ok button.

    Scrollbar3.gif 

     

  • Now Tasks list web part will be added to the default.aspx page.

    Scrollbar4.gif 

Step 2: Customizing Look and feel of the Task List Web Part.

  • Click on "Add a Web Part" and add a Content Editor Web Part.

    Scrollbar5.gif


    Scrollbar6.gif

  • Now click on the edit menu of the Content Editor Web Part and choose Modify Shared Web Part.
     

  • Now Tool Pan will be open to modify web part.

    Scrollbar7.gif 

     

  • Click on source editor and paste the following code.

    <style type="text/css">
    .ms-WPHeader TD h3
    {
       .margin: 0;
       padding: 3px 0px 2px 5px;
       height:24px;
    }
    .ms-HoverCellInActive
    {
      
    margin: 0;
      
    padding: 3px 0px 3px 0px;
      
    height: 10px;
    }
    .ms-WPBorder
    {
       border-color: #85B2ED;
       border-width: 1px;
       height:50px;
       overflow:auto;
    }
    .ms-WPBodyHeight
    {
       overflow:auto;
    }
    </style>
    <
    script type="text/javascript" src="/_layouts/LSFIntranet/Scripts/jquery-1.3.1.js"></script>
    <script type="text/javascript" src="/_layouts/LSFIntranet/Scripts/jquery.corner.js"></script>
    <script type="text/javascript">
        //Change these variables
        var backColor = "#B5BEC6"
        var textColor = "#002473"
        AddWebPartCorners();
        function AddWebPartCorners() {
            $(".ms-WPHeader TD h3").css("color", textColor);
            $(".ms-WPHeader TD h3 a:link, .ms-WPHeader TD h3 a:visited").css("color", textColor);
            $(".ms-WPHeader TD h3").css("background-color", backColor).corner("tl 7px");
            $(".ms-WPHeader td").css("padding-right", "0px");
            $(".ms-WPHeader td").css("border-bottom", "0px");
            $(".ms-HoverCellInActive").css("background-color", backColor).corner("tr 7px");
             $("div[id^=WebPart]").addClass("ms-WPBodyHeight");
        }
    </script>
     

  • Now change the chrom state default to none of content editor web part and click on Ok button. 

    Scrollbar8.gif 

     

  • Now to add a scrollbar modify Tasks list web part and set height to 100 px from Appearance section.

    Scrollbar9.gif 

     

  • Add some items in the tasks list to view scroll bar..

        Scrollbar10.gif

Thanks for reading this article.

Login to add your contents and source code to this article
share this article :
post comment
 

which webpart need to change here " $("div[id^=WebPart]").addClass("ms-WPBodyHeight");"? thx u

Posted by nge lay Feb 06, 2012

Dear Sir, how did you manage to combine 2 webparts? i want anouncement webpart to show scroll bar. but i can't combine that two webparts. pls explain me asap. Thank you so much.

Posted by nge lay Feb 06, 2012

Hi I fallowed the abouve instructions, but scroll bar is not coming. PLease help

Posted by Lakshmi H S Jun 10, 2011
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Nevron Gauge for SharePoint
Become a Sponsor