Home » Sharepoint 2010

Customizing the layout / style of a Document Library Web Part

Hi all,

I've searched for quite a while now and I can't find a solution.

What I'm looking to do is customize the appearance of a Document Library Web Part.  Applying styles to the Web Part with CSS is no bother (and is quite frankly easy).  What I'm looking to do is change the layout more than anything.  I don't want it parsed as a table, but rather in a custom layout (with DIVs and such) that allows me to basically say "insert <document title> here".

Best to lead with an example: http://www.healthyrespect.co.uk/downloads-and-campaigns/resources-for-young-people.htm

Could I replicate the functionality on that page with a Document Library Web Part?  Having the title of the document appear in a <h#> tag (with a link to the document) along with a description field.

I'm happy to dive into Visual Studio if someone can point me in the right direction.



Hey guys, is there a way for me to change the style of the media web part to something else besides light and dark? Someone suggested that the style is really ugly. If only I can re-skin it somehow.

Hi there,

I am trying to have one web part display documents (or list items) from different document libraries (or different lists) from different site collections.

I have achieved this under a single site collection using Data View Web Part (using SPD).

I have also achieved displaying a single document library (or a list) from a different site collection by using List View Web Part.

but I am not sure how to get my head around displaying documents or list items from different document libraries or lists across site collections.

I have thought of using SPSiteDataQuery or ListViewByQuery, but they all seem to focus one site collection at a time.

If any of you have done this before, please share your best practice on this one with me.

Much appreciated.



This is very urgent and high priority business requirement. Kindly help me to accomplish the below task.


1.      There should be an option to “Discuss” certain document. Note that the discussion MUST be linked to the document.

2.      If the “Discuss” dropdown is pressed – a new discussion thread should be created.  Note:  the discussion board should be set separately as prerequisite.

3.      When user is submitting their comment there – workflow auto email should be generated. We can predefine the distribution list.

4.      The auto email should contain:

a.      The comment from discussion board

b.      Option to reply the in the discussion board

c.       Link to the document (dynamic according to the document link)

d.      Link to the cockpit page (predefined)

5.      If someone replies in the discussion board – another email should be generated – but including the previous discussion/comments. Latest comment should be on top.

6.      User should be able to access the history of the discussion (read from start to finish like in email). We can leverage the same dropdown option “Discuss” or if not – pls propose other options.



My users need to add metadata to documents they check out of a Document Library while they are in the document. That works fine (the forms appear at the top of the Word Document, underneath the task bar). However, the layout of the forms is kind of bad. Is there a way to redesign the forms in the top of a word document so that they look better?




I have developed a custom web part that can upload a file from local hard drive (PC, not server) to a document library using "System.Web.UI.WebControls.FileUpload" control.

But, I need to upload a folder (including sub folders and files in it) from local hard drive (PC, not server) to a document library. 


I have gone through web service approach (calling Lists service) by creating a Windows Form Application  that can upload file and folder to document library successfully.


But, problem with this approach is that my client (Company) want this to be a web part instead of a client application.


Is there any way to upload a folder from local hard drive to a document library by implementing a custom web part?


Particularly, is there any control available  in "System.Web.UI.WebControls" that will allow me to brows through  a folder from my local hard drive? I am expecting something similar to  "FolderBrowserDialog" that is available for Windows Form based application or some other machanism to do the similar.

Seems like I do not find anything in System.Web.UI.WebControls" that can brows a folder in local hard drive similar to "System.Web.UI.WebControls.FileUpload" control.

I will appreciate any information regarding this from this comunity.

Thanks in advance for your valuable time  and effort.



I have something rather weird happening on a brand new SP 2010 Server site. I’d be grateful for your thoughts.


On the right side web part zone of my Home page, I have a link list web part that contains some folders with interior links as well as single links at the top level. You click on the folder links and it refreshes and shows only the links inside. This all works as expected.


I also have a web part on the left side of the Home page that simply points to the one and only document library.


However, whenever someone clicks on a link list folder, the proper action of refreshing the link list occurs showing the links inside, but the document library web part on the left does not stay with the default view as it should. Instead I get a long list of garbage with file names showing up as "1" or "0" or "2" or "first floor".


It's really weird. How come I don't get my same document library list as is present when I click the home page URL?


I can tell you that this setup on MOSS 2007 does NOT exhibit the same behavior. The original default view of the document library remains the same each time.


I’m stumped…thanks for the help!


P.S. Is there anyway to post some screenshots? I have 2 of them.


I have created a Document Library Template and also a custom View and marked it as Default View. When I create a new Document Library using that template, the list view defaults to the custom view that I created. Everything is fine upto this point.

However, when I try to add the Document Library that I created as a Web Part to a page, the default view is "All Documents" instead of the custom View I created. What settings should be done to make the Web part view for the Document Library to default to my custom view instead of "All Documents" ? I would appreciate any help.


I have created a Document Library Template and also a custom View and marked it as Default View. When I create a new Document Library using that template, the list view defaults to the custom view that I created. Everything is fine upto this point.

However, when I try to add the Document Library that I created as a Web Part to a page, the default view is "All Documents" instead of the custom View I created. What settings should be done to make the Web part view for the Document Library to default to my custom view instead of "All Documents" ? I would appreciate any help.


I am looking to create a custom document library web part to be added to the home page for our internal company website. I've done some searching but I can't seem to find any tutorials that demonstrate what I am looking for. 

This needs to be a web part that I add to the main page and performs somewhat like Windows Explorer.

Here is a link to an image of what I am looking for: http://imgur.com/ppinn.jpg

Also, I am not very familiar with coding but I am able to figure things out with good examples. I assume jQuery would be the easiest language to do this in but if anyone has any other suggestions that would be great.

If anyone could point me in the right direction that would be great, thanks!


Is there any way where I can merge "List web-part" and "Doc Lib web-part" using Dataview web-part using SharePoint designer.

I have merged multiple lists and multiple document libraries separately using dataview to display top five/six / n number of items from all of them. However I was unable to merge the list with document library.

Can anyone please help me to solve the problem.



 Is it possible to cuztomize "Add document" link in document library . I need to change the label to  "New Form" . Is it possible to change the functionality also .


Hi all

Each time i create sites, I get a custom welcome page for that site. On that custom page layout of mine I want to have the newly created site's document library on it. Is that somehow achievable?

I am trying in SPD but not having much luck as of yet. Any ideas?



I am trying to create an "Upload a Document" button in a SharePoint document library using the code from the Document Center landing page in order to display the upload form. 

I have added a content editor web part in a different document library and edited the path to the document library but I find the button action does not work. 

<div class="ms-uploadbtnlink"><button onclick="javascript:OpenNewFormUrl(&#39;Documents /Forms/upload.aspx&#39;);return false;" type="submit"><nobr><img alt="Upload a Document" src="/_layouts/Images/uploaddoc.png"/>&#160;<span>Upload a Document</span></nobr></button> </div>

Is there something I am missing, is this not as simple as it seems?


Environment: - MOSS 2007 (SP1)
Questions :- Document library/ limitations of CAML Query on the document library with huge documents

Within a site collection we have a single document library where the documents are being placed, the number of documents in the document library are now in thousands.

The requirement is that all the documents (newly added) should be available through the custom search. For which we have used the CAML query to retrieve the documents from the single document library document library, which is now working good.

If you ask me why have we not used the SharePoint search?
That is because the client wants the newly added documents also to be visible in the search, and until the crawling is performed the documents will not be available on the search.


1)      Is it a right approach to place incremental crawls every minute on the single document library?

2)      As we are using CAML Query, will the performance of the Custom search (retrieval of the documents) degrade if the documents increase in number?

3)      The Crawling is not performed on the single document library as we are not using the SharePoint search.

Even though we are not using SharePoint search, will the crawling of the document library give a boost to the CAML Query in the longer run?

4)      What steps should be taken to plan for the document library and improve the performance?

Appreciate your time and advices,  I am just a small SharePoint admin trying to learn different aspects of SharePoint .



I am pacing a problem which is  to add duplicate content editor web part in custom page layout.I mean i don't want add two content editor web parts in my custom page layout.




Hi All

i have a requirment to customize the Send To Other Location funtionality. while using OOTB Send to Other Location option for a document library item

we have  selection like

Prompt the author to send out updates when the document is checked in?

<input id="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateYes" name="ctl00$PlaceHolderMain$ctl01$ctl01$ShouldUpdate" type="radio" value="RadShouldUpdateYes" /><label for="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateYes">Yes</label>
<input id="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateNo" checked="checked" name="ctl00$PlaceHolderMain$ctl01$ctl01$ShouldUpdate" type="radio" value="RadShouldUpdateNo" /><label for="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateNo">No</label>

how we can set this option in my custom coding based on the user selection. i am not able to understand the functionality of the above option.

can any one please explain the above option and let me know how to set this option programmtically in my custom code.


Thanks in Advance


I have a Welcome Blank Web Part Page.  The layout diagram shows that the top web zone takes up 3/4 of the width of the page, and that there is a tall column to its right that takes up the remaining 1/4 width.  However when I drop a Content Editor web part into the top zone and the right hand zone, it ends up that each zone renders as 50% the width of the page.  Why is that and how do I fix it?  I don't want to set zone widths in pixels.  I would set in percentages if the option was provided in MOSS 2007.

Hi friends,

I'd like to customize the "Setting" page of a document library, and add a my custom setting linkto the page. By clicking the page, a new form will open allowing user to fill in detailed properties. Then by clicking the save button on that page, the additional setting can be stored in sharepoint persistent layer.

Anyone can give some hints?


EaTing Shan


       We have a requirement to apply audience to the items in SharePoint Search Results. So we followed the following approach.

Create a Web part class and inherit the web part from CoreResultsWebPart web part
                        Override the GetXPathNavigator  method and Write the following code
                        Get the Search results in form of Xml Document
                        Loop through each result Node <Result> and get the url of each Item
                        Get the Audience for the Item and check the Audience against current User
                        Filter item data based on audience
                        Display the result based on the audience

publicclassHRWebSearchCoreResultsWP : Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart


            protectedoverrideXPathNavigator GetXPathNavigator(string viewPath)


                             System.Xml.XPath.XPathNavigator results = base.GetXPathNavigator(viewPath);

                             XmlDocument xmlDoc = this.xmlResponseDoc;

XmlNodeList resultNodes = xmlDoc.SelectNodes("//Result");

                             for (int i = 0; i < resultNodes.Count; i++)


                                    //Get the Audience Value for Each and Check for Audiencing against the current User




By default, the result XML document  doesn't have the audience property and hence we need to loop through each Result item to get the Audience value using SharePoint API. If the number of search results are high, then looping through each item will result performance problem.

Is there any way to get the Audience information for each item along with the search Results?. Also, let me know if there is any better approach for doing the same.




Hi there,

I have a web part that was working perfectly fine in a wiki page (in the site pages library) - however as soon as I add that web part to a webpart page I lose some of my styles that are applied inline.

More specifically I had some inline styles in a <tr> tag to show a border-bottom however that border-bottom just does not display in the webpart page.

In the wiki page it displays perfectly fine.

Any help is appreciated.

Note: The reason I don't want to use a wiki page is because of this known problem: http://support.microsoft.com/kb/981227




<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure