Customize SharePoint Search Results Paging…!!!


Recently I had a requirement to customize the OOB SharePoint search results paging control (SearchPagingWebPart). So below is the problem definition and the solutions I came across. (the link to the downloadable source code for the solution is attached at the end of the post)

OOB paging control gives you several options to specify and define the paging behavior.

image

Most important properties for me are the first two ones.

1) Maximum page links before current
2) Maximum page links after current

So with the above configuration paging will look like this:

image

Its fare enough so the current page is 1 and there are no pages to be displayed as previous links. so it will display only 3 after links.

When you navigate to a page in the middle it will look like this:

image

So its now displaying 4 before links with page numbers and 3 after links.

Continue reading

Set Properties on a List View Web Part…


Hey buddies. Smile Ever wanted to set some properties on a List View Web Part? Had issues doing it? End up with no solution? Here you have the solution.

Recent past I had a requirement to create a page instance with a Calendar Month view embed in a web part zone. So my first thoughts was to create a page manually, add the required calendar View to it, set all custom properties (hide chrome is the only thing I had to do) and export. Oh Gosh, at the last step I realized you cannot export the Calendar View Sad smile.

Any how reading through the net I found a way to export the Calendar List View. But it contains some GUIDs that refers to the Default View of the calendar, that is created when the web part is provisioned and that I cannot predict before hand. Now what?

Continue reading

Display Document Type Icon in a DVWP


I had a requirement to display document icons inside a Data View Web Part. While googling I found some interesting information on this document types and there icons.

SharePoint has a pre populated list of document types along with respective images that maps to it. This document type to document icon image mapping can be found inside the file DOCICON.XML which can be located in the following location  C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML
Continue reading

Recursive Data View Web Part…


Recently I had to give a hand to one of my friend to create a recursive DVWP. What this web part should do is to query all the sub sites including the root site, and retrieve all the Pages resides inside the Pages libraries. Also it should filter the retrieved pages for a given content type. Previously I had done whole lot of DVWP, but never wanted to create a recursive DVWP.

So how to achieve this,
Continue reading

Embed Content Editor Web Part inside a Web Part Zone…


Once I had a requirement to embed a Content Editor Web Part, with some default content, to a web part page. So I followed the usual steps to extract my web part.

1) Add a CEWP to a Web Part zone in my SharePoint web site.

2) Add the default content that was needed, and format it appropriately.

3) Export the web part as a file.
Continue reading

Is my SharePoint web page in Edit Mode????


Hi all,

Recently I developed a custom web part, to get some user feedback. The web part contain some validators (required field validators) and some of my custom web part properties (A property to get a SharePoint list URL). After completing the web part I embed it on a page. While testing the web part, i noticed when I go edit web part properties, and try to save my changes by pressing OK, or Apply button, it trigged all my validators.
Continue reading