SPGridView Problem – Paging and Grouping Tuesday, Dec 8 2009 

Hi guys, i hope u all enjoyed my previous posts. Here i would like to share some information regarding SPGridView in SharePoint. It is one of the most effective and advanced control in SharePoint. Many of them have used this control and they succeed in their part. As per one of the client requirement i have developed a application page with SPGridview and i have added Paging and Grouping. First i add only the paging with custom paging template it works fine. But, when i try to add the Grouping it throws an Unknown Error. I have searched all over the net and i have found the solution. If anyone has encountered this problem please change the EnableViewState property to false and it will work.

Cheers…

To create a minimal master page Monday, Sep 1 2008 

  • Open SharePoint Designer.
  • On the File menu, click New, point to SharePoint Content, and then click the Page tab.
  • Double-click Master Page to create a new master page.
  • Click Design to show the master page in design view. You should see header and left margin areas and several content placeholders in the master page.
  • Click Code to show the master page in code view.
  • Copy the Code into the Master Page.
  • On the File menu, click Save As, provide a unique file name with the .master extension, and then save the file to the master page gallery (/_catalogs/masterpage) in your site collection.

Cheers…

How to: Create a Minimal Master Page Monday, Sep 1 2008 

Introduction
One of the first tasks that you must complete when configuring a Microsoft Office SharePoint Server 2007 Web site is to create one or more master pages. A master page contains references to elements that you can share across multiple pages in an Office SharePoint Server 2007 site, such as navigation, search controls, logon controls, and banner images. A master page can also contain the cascading style sheet (CSS) and ECMAScript (JScript, JavaScript) references that define the overall look and feel of your site. Commonly, every site—and therefore every page—in your site collection uses the same master page to present a consistent user experience across the entire site collection. Depending on your needs, you can use a different master page for one or for all of the sites in your site hierarchy to distinguish the various areas of your portal.
Master Page Galleries
When you provision a site collection in Office SharePoint Server 2007, the system creates a master page gallery that contains all the master pages and page layouts for that site collection. If the site collection uses either the Publishing Portal or Collaboration Portal templates, the master page gallery includes several master pages that are provided with Office SharePoint Server 2007, such as BlueBand.master. These master pages are located in the path C:\Program%20Files\Common%20Files\Microsoft%20Shared\web%20server%20extensions\12\TEMPLATE\FEATURES\PublishingLayouts\MasterPages\, with other example .master pages. You can use any of these master pages as they are, or you can customize them fully to create unique branding for your site.
Why Start with a Minimal Master Page
Creating and completing a master page to begin your SharePoint site customization takes planning and time. If you can, you want to prevent having to rewrite or back out code you don’t need in your master page. This topic shows you how to create a minimal master page that includes only the minimal functionality that Office SharePoint Server 2007 requires so that you have a stable platform upon which to build your own master pages. Creating a minimal master page can help you avoid the time-consuming process of backing code out of a pre-existing .master page such as BlueBand.master, or removing functionality and then building it back in when your customization needs change again.
You can, of course, create a master page from scratch. However, we generally do not recommend this because a truly empty master page does not include all the content placeholders that the Office SharePoint Server 2007 page model needs to work correctly.
The sample code in the following procedure includes only what the Office SharePoint Server 2007 page model requires—necessary content placeholders and controls to work with the page layouts that are included in a default Office SharePoint Server 2007 installation. Office SharePoint Server 2007 requires a master page that includes a title, branding, logon functionality, search functionality, breadcrumb functionality, and basic structural elements such as page areas, separators, borders, consoles, and description placeholders.
The following procedure uses Office SharePoint Designer 2007 as the master page design environment. You can, however, use a text editor, a Web editor such as Microsoft Office SharePoint Designer 2007, or an integrated development environment (IDE) such as Microsoft Visual Studio 2005 to create a master page.The master pages included with Office SharePoint Server 2007 are based on the SPWeb.CustomMasterUrl property of the SPWeb class in Windows SharePoint Services.
Cheers…

How to:Extend the Navigation Provider Saturday, Aug 30 2008 

You can extend the navigation provider in Microsoft Office SharePoint Server 2007 by deriving a custom provider class from any of the default site map providers. Deriving from an Office SharePoint Server 2007 site map provider supplies several benefits such as navigation node caching and security trimming. The following code example derives from the PortalSiteMapProvider class and demonstrates how to add items to the site map provider. Although the site map provider classes have approximately twenty abstract or virtual methods, only a small number must be overridden and implemented in a custom site map provider.
  • Create a Microsoft Visual C# class library project with following code, add the required references, and then build the project.

using System;using System.Collections.Generic;using System.Text;using Microsoft.SharePoint.Publishing;using Microsoft.SharePoint.Publishing.Navigation;using System.Web;using System.Web.UI.WebControls;using System.Configuration;

namespace MyCustomNav

{

public class Navigation: PortalSiteMapProvider

{

public override SiteMapNodeCollection

GetChildNodes(System.Web.SiteMapNode node)

{PortalSiteMapNode pNode = node as PortalSiteMapNode;

if (pNode != null)

{if (pNode.Type == NodeTypes.Area)

{SiteMapNodeCollection nodeColl = base.GetChildNodes(pNode);

SiteMapNode childNode = new

SiteMapNode(this, “”,

“”, “Microsoft”);

SiteMapNode childNode1 = new

SiteMapNode(this, “”,

“”,

“Support”);nodeColl.Add(childNode);

SiteMapNodeCollection test = new

SiteMapNodeCollection();test.Add(childNode1);

childNode.ChildNodes = test;return nodeColl;

}elsereturn base.GetChildNodes(pNode);

}elsereturn new SiteMapNodeCollection();

}}}

  • Copy the .dll file you created in step 1, and then paste it into the Office SharePoint Server 2007 virtual directory’s bin folder.
  • Create the following entry in the web.config file for the Web application, and then set the trust level to Full.

<add name=”MyCustomNavigationProvider” type=”MyCustomNav.Navigation, MyCustomNav”
NavigationType=”Current”/>

  • Create a custom master page and add the following code under the top navigation’s ContentPlaceHolder element.

<sharepoint:aspmenuid=”topnavigationmenu” runat=”server” datasourceid=”topSiteMap1″ enableviewstate=”false” accesskey=””>” Orientation=”Horizontal” StaticDisplayLevels=”1″ MaximumDynamicDisplayLevels=”3″ DynamicHorizontalOffset=”0″ StaticPopoutImageUrl=”/_layouts/images/menudark.gif” StaticPopoutImageTextFormatString=”” DynamicHoverStyle-BackColor=”#CBE3F0″ SkipLinkText=”” StaticSubMenuIndent=”0″ CssClass=”ms-topNavContainer”>

<staticmenustyle/><staticmenuitemstyle cssclass=”ms-topnav” itemspacing=”0px”/><staticselectedstyle cssclass=”ms-topnavselected”/><statichoverstyle cssclass=”ms-topNavHover”/><dynamicmenustyle backcolor=”#F2F3F4″ bordercolor=”#A7B4CE” borderwidth=”1px”/><dynamicmenuitemstyle cssclass=”ms-topNavFlyOuts”>/><dynamicselectedstyle cssclass=”ms-topNavFlyOutsSelected”/></SharePoint:AspMenu>

<asp:sitemapdatasource showstartingnode=”False” sitemapprovider=”MyCustomNavigationProvider” id=”topSiteMap1″ runat=”server” startfromcurrentnode=”true”>

  • Reset Microsoft Internet Information Server (IIS). Your SharePoint site should now show the updated navigation from the extended navigation provider.

Still more to come…

Cheers…