SharePoint 4 Developers

Additional reference guide in .NET / SharePoint Development

Grouping by Content Type is missing in View Settings

In SharePoint 2010, the option for grouping by Content Type is missing, no longer available for users! What to do in this case? SharePoint Designer 2010 helps us to solve this problem.

Hi folks,

Currently I am working on a SharePoint 2010 Migration (from MOSS 2007). Most part of the work is done by scripting, however some tasks can be done manually because is much faster.

I include in these tasks quick fixes, which can be made by the user interface. Just telling that, because I had to repair some views that contain groupings and noticed that in SharePoint 2010, the option for grouping by Content Type is no longer available for users! What to do in this case? SharePoint Designer helps us to solve this problem.

Simulating the creation of view grouped by Content Type

A user needs to create a view that groups items by Content Type. How to accomplish this task?

In the Figure 1 there is a Document Library which contains some documents. Select the option Create View directly through this visualisation.

Create View Figure 1 – Option for creating a view

The next step is to choose the view format, in this case a Standard View can be chosen, according to the Figure 2:

Standard View Figure 2 – Choosing the view format

Name the view to Grouped by Content Type (for example), according to the Figure 3, then go to the Group By section and select the option Content Type according to the Figure 4. Oops…Where is it? In MOSS 2007 that was available!

View Name Figure 3 – View Name

Grouping Figure 4 - Column selection for grouping by

The Content Type option is no longer available in SharePoint 2010! In order not to encounter such pranks during the SharePoint 2010 Migration, do usability testing with real users, because they work everyday with SharePoint and know what is essential for their daily tasks.

Using the UI there is no exit, just save the view.

Workaround utilising SharePoint Designer 2010

Open the SharePoint Designer against the Web Site in which the Document Library was created, according to the Figure 5:

SPD2010 Figure 5 - Document Library

Skip to the opening of the newly created view according to the Figure 6:

SPD2010 View Figure 6 - Newly created view selection

In regards to the Grouping By section, this is the XMLDefinition snippet that was created automatically after saving the view. In other words, it is empty! As we can see in the Figure 7, just the description of the empty element Query is available:

XMLDefinition1 Figure 7 - Empty XMLDefinition Snippet

Alter this code snippet to contain the group by Content Type as per Figure 8. It does the trick:

XMLDefinition2 Figure 8 - Grouping by defined in the XMLDefinition

The same code snippet is below for copying:

Code Snippet
  1. <GroupBy Collapse="TRUE" GroupLimit="100">
  2.   <FieldRef Name="ContentType"/>
  3. </GroupBy>

Note: This code snippet defines the grouping by Content Type, besides, it defines that items will be collapsed by default and limited for displaying 100 items per grouping by.

In the end here we have the expected outcome, according to the Figure 9:

Outcome Figure 9 - Final Outcome

Finally we've got the expected outcome! A task that was simple before, now just can be done with the utilisation of a tool, and just in case the user has privileges for that.

Reference:
SharePoint Developer Center Forum

Cheers,

Marcel Medina

Click here to read the same content in Portuguese.

Code Camp & Technology Summit

This last weekend I had the opportunity to go to the Code Camp &amp; Technology Summit, an event for developers and IT pros, here in New Zealand. This event was organised by the MSCommunities and took place at the University of Auckland.

Hi folks,

This last weekend I had the opportunity to go to the Code Camp & Technology Summit, an event for developers and IT pros, here in New Zealand. This event was organised by the MSCommunities and took place at the University of Auckland.

There were many sessions, grouped by the following categories: Developers, SQL, SharePoint and Infrastruture. I have participated in the .NET presentations and SharePoint. Of course!

Well, here are some images of the place and the auditoriums, BTW really nice.

DSCF0048 DSCF0049 DSCF0050 DSCF0051 DSCF0056 DSCF0059

Cheers,

Marcel Medina

Click here to read the same content in Portuguese.

1 Year of Blog!

1 year of blog! Time flies! This deserves a post and a celebration, especially because I have persisted with my posts and articles along this time! :)

Well, I can say that was and is a challenge to keep this blog every day, because I always focus on sharing unique information and very detailed about .NET/SharePoint development. This involves a lot of work, because it is necessary time for ideas, research and writing, which is something I really enjoy doing and there is nothing better than seeing your articles being used and becoming reference to the work of others.

1ano Another important factor that has motivated me is the participation in communities in Brazil and here in New Zealand. Along the time you get to know other people who share the same ideas and interests, and as a result your contact networking also increases.

As an outcome of that is my participation in CanalSharePoint as moderator, which I consider extremely important, because the CanalSharePoint is one of the major channels for learning SharePoint in Brazil. Here are my thanks to the leaders Bruno Velaz, Heber Lopes and Wagner Amorim. Thanks guys!

Another community that also have the opportunity to participate and collaborate is the Codificando.NET. I also have to thank Diego Nogare for supporting me with the articles and Fernanda Sallai for supporting me with the publication of articles at the Revista Codificando.NET.

My participation in the SPUG (SharePoint User Group) from Auckland is still not significant, but I intend to contribute more to this community.

The launch of the domain sharepoint4developers.net also deserves celebration, it was something I always wanted and could implement it this year, moving the blog from Windows Live Spaces.

Well, this is just the first year and many things has happened. I wish the following years to be even better!

Cheers,

Marcel Medina

Click here to read the same content in Portuguese.