Customize Top Navigation Programmatically in SharePoint

Requirement: Had to customize the Top navigation with bunch of provided internal/external links as part of a branding project. Solution: Designed a feature to programmatically add links to top navigation bar. when activated, feature will add bunch of links to the top navigation bar. Customize navigation programmatically in SharePoint: In another SharePoint…

Read more

How to Create SharePoint List or Library Programmatically?

At times, We may have to create List or Document Libraries programmatically. These code snippets will help to get it done. Create a Document Library in SharePoint Using .Net Object Model (C#) For all available List template types, Refer: SPListTemplateType Create a SharePoint List using PowerShell:

Read more

Activate-Deactivate Features Programmatically in SharePoint

At times, We may have to activate/deactivate features programmatically. Here is the code snippet: PowerShell way to Activate-Deactivate Features: To activate a feature in PowerShell: Enable-SPFeature -identity <Feature-Folder-Name/GUID> -URL <URL-of-Web-app/Site coll/Site> To deactivate a feature: Disable-SPFeature -identity <Feature-Folder-Name/GUID> -URL <URL-of-Web-app/Site coll/Site>

Read more

Set Sorting, Filter, Group By in SharePoint Views Programmatically

SharePoint List views uses CAML internally to Filter, Sort list items. In a Recent project, we had to programmatically set the Filter and Sort order of default views. How to Get the CAML? Simple! use U2U CAML Query builder, one of my favorite SharePoint tool. C# code to set the View Filter,…

Read more

How to Create Custom Application Page in SharePoint 2010 to get List Owners?

In my environment, This is one of a Frequently asked question: How do I find who has created a List or Library? oops, I don’t find any direct way from SharePoint interface to know who has created a List or Library. Lets develop a Application page, host it under Layouts folder and…

Read more

How to Set Welcome Page Programmatically in SharePoint?

By default, SharePoint uses “default.aspx” page as the welcome page (or Home page) in SharePoint 2007 and “SitePages/Home.aspx” in SharePoint 2010. It uses Pages/Home.aspx when publishing feature is enabled under MOSS 2007. If you want to change Home Page: SharePoint provides users an interface to set the welcome page once Publishing feature…

Read more

Iterate through All SharePoint Web Applications, Site Collections, Sub-sites, Lists and List Items Programmatically

Often in development, we may have to iterate through all web applications, Site collections, sites, Lists and List Items to get some job done or generate reports. Here are the code snippets to help. Iterate Through all web applications, Site collections, Sites, Lists and List Items Using C#: Starting the Loop from…

Read more

Alert Management Web Part – Released!

Received a lot of emails from people who read my post Alert Management Web part Mock-up on Alert Management Web Part Solution. Business Problem: In a Project management site, When new project sites created, the Project Manager creates alerts for all team members in multiple Lists/Libraries.  The pain point is: He needs…

Read more

Programmatically Check whether a Particular List/Library Exists or Not

How to check if a list exists in SharePoint programmatically? SharePoint 2010 offers TryGetList Method to determine the existence of a List programmatically. TryGetList returns null if the specified list doesn’t exist. SharePoint 2010 check if list exists: MOSS 2007: In SharePoint 2007, we have to write our own method to check…

Read more