Showing posts from 2011

SharePoint Datasheet View - The selected cells are readonly

This happens because:
The field is a read-only fieldThe view has folder-content typesYou installed Office 2007 SP3
For the first issue you can use the tool "SharePoint Manage". Drill down to the field and change the property "ReadOnlyField"

For the second issue modify/create your list view and select in the Folder section "Show all items without folder"

The Solution for the third issue is to change the field type from Enhanced rich text (Rich text with pictures, tables, and hyperlinks) to Rich text (Bold, italics, text alignment).

There seems to be also a fix from Microsoft

SharePoint Enterprise Content Types and Contenty Type Hubs

With Content Type Hubs in SharePoint 2010 you can now easily distrubute your content types over all webapplications and sitecollections. Now you can define a single sitecollection in which you manage your content types. All other sitecollections can consume from this site.

1. Create Content Type Hub
Before you can use Enterprise Content Types you have to define a Content Type Hub. The Content Type Hub is a single arbitrary sitecollection. The probably best way is to create a new sitecollection with the blank site template for this purpose.

2. Configure Service
After you have created the sitecollection you have to tell the service where to consume the content types. The service which manages the enterprise content types is the "Managed Metadata Service". If you dont't have this service, you have to create it first. If the service already exists follow these steps:
Go to central administration Application ManagementService Application - Manage service applicationsClick on t…

Limiting the SharePoint People Picker with PowerShell

We had the problem that the searching after people in the Active Directory took very long. If you don't limit the people picker in SharePoint it searches the whole domain and all forests within. This can be very time consuming when the picker tries to resolve the names ( In out company about 1 minute).

Therefore we decided to limit the people picker by domain. The problem is that you can define this limitation only on sitecollection level. This means that you have to do that each time you create a new sitecollection.

I wrote a powerhell script which loops throught alle sitecollections and restricts the one, which do not already have a limitation.

#Powershell for Changing People Picker Settings #Author I.Bikmaz #Add SharePoint SnapIn $snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'} if ($snapin -eq $null) { Write-Host "Loading SharePoint Powershell Snap-in" Add-PSSnapin "Microsoft.SharePoint.Powershell&q…

Drill Down with the SharePoint Chart WebPart

There is a new webpart in SP 2010, the chart webpart, which is very impressing. You can connect it to SharePoint List and WebParts.

Today I wanted to drill down the pages when I click an element of the webpart. It seems that Microsoft bought this webpart from Dundas, so you have to look the syntax there

Follow the steps:

In step 3 click "next" also in step 4.

In step 5 click on the "Hyperlinks and Tooltips" tab. Enter following Url to the fiels:

whereas #LABEL is a keyword mentioned in the support links above

Hiding the title Field in SharePoint the simple way

I find these two ways as the simplest:

Using the SharePoint Manager

Every SharePoint Admin should have the Sharepoint Manager. Just download it to you SharePoint Server and open it. No installation is needed.

Drill down to the list you want to modify. If you click on the list all fields are show. You will see 4 Title fields. Select the Title field with the Internal Name "Title". You can check the internal name in the properties window on the right if you click on a field.

Now change the values for "Hidden" to true and "Required" to false.

Using Powershell

I don't reinvent the wheel so look at "Phil Childs" site. There is a simple PowerShell script you can use to modify each field and of course also the title field.

"Access Denied" when editing a page as site owner

I am in the site owners group and have full permissions. But when I try to edit a page an access denied error occures. I can checkin and checkout but cannot edit the page. If I put me into the site collection admin group, the page can be edited.

This happened to me today and it took me 2 hours to find the problem. I was aware that the problem was not that I have not the correct rights, in fact I assumed that there is something in the page that was not published or something I don't have the rights to edit.

Following could be possible:

I have a WebPart on the page, that tries to read an item or site to which I don't have access.I have a link on the page to an unpublished itemI have problems with an unpublished page layoutProblems with the master pagePoint 1 was not the issue, because I didn't has custom or any webparts.Point 2 was also not the problem. I took everything out of the page, but the problem still occuredPoint 3 was also not the reason for the error. I checked th…

MatchPoint - Configuration of Tag-Icons

Each Tag in MatchPoint can have its own icon. The configuration of the icons can be found in the MatchPoint Administration sitecollection, which hosts the MatchPoint instance.

The icons for the tags must be located in the images subfolder of 14hive folder in each web frontend server. The easiest way to open the images folder is to paste the following command line into the explorer bar:
"%COMMONPROGRAMFILES%\microsoft shared\web server extensions\14\Template\Images"
The images will not be resized so if you create your own images please ensure that they have the right format,
16x16 I think. Within the images folder you can create your own subfolder structure for your images.

As an example we have the following Tag structure. Sprache (Language) is a toplevel tag. It has 3 other child tags : German (Deutsch), French (Französisch) and Italian (Italienisch).

After you've copied all images to the images folder, you need to create a mapping between the tags and the images. There…

Visual upgrade error in SharePoint 2010

I got following error when I made a visual upgrade:

"One or more field types are not installed properly." (in German: Mindestens ein Feld ist nicht richtig installiert. Wechseln Sie zur Listeneinstellungsseite, um diese Felder zu löschen.)
The error occurs due to a problem in the hidden relationshiplist. The entries are not updated properly. See Problems with visual upgrade.

The solution for this problem is easy: Install the newest Cumulatives Updates.

Most viewed documents in SharePoint 2010

The Task You want to see the top 10 most viewed documents in a library

The Answer 1. Enable the two reporting features in your site collection features.

2. Go to the list and click on "Library Settings" in the ribbon

3. Click on "Information management policy settings" under "Permission and Management"

4. Click on document

5. Activate the checkbox "Enable Auditing" and select "Opening or downloading documents, viewing items in lists, or viewing item properties"

Now the auditing is enabled and each time when an item in the doclib is viewed a log entrie is generated. You can limit the size of the lib in the site collection settings under "Site collection audit settings" in the group "Site Collection Administration". Here you can specify that the log should be holded for a period of time.

6. Create a custom webpart or control. Here is the sample code to get the entries you want

using (SPSite site = new SPSite(mUrl)) …
I got the following error as I tried to run a console application to get data from SharePoint 2010:

the web application at ... could not be found. verify that you have typed the url correctly. if the url should be serving existing content, the system administrator may need to add a new request url mapping to the intended application.

The problem is that the default settings for a console project are .Net Framework 4 and Platform target X86. Change these settings to .Net Framework 3.5 and x64 and everthing will work fine.

jQuery and SharePoint 2010 conflict

When you try to use jQuery with SharePoint 2010 you could get problems in some browser like IE. This is caused because of conflicts with the Microsoft JavaScript selector "$", which is the same variable as the jQuery selector.

To avoid conflicts you can easily use the noConflictmethod of jQuery and change the selector for jQuery.

var $j = jQuery.noConflict(); $j(document).ready( function() { $j("#content").addClass("..."); });
For more information see jQuery.noConflict.

SharePoint Migration of Publishing Content Types

When you migrate your Publishing Content Types from SharePoint 2007 to 2010 you have to do some changes to you xml definition. There are two new attributes to consider when creating or migrating Content Types:
InheritsOverwrite The Inherits attribute When you p.e. migrate a custom "publishing content type" that derives from the default page content type you must use the inherits attribute to display your custom fields.

Now take a look what msdn says:

Optional Boolean. The value of this attribute determines whether the content type inherits fields from its parent content type when it is created.

If Inherits is TRUE, the child content type inherits all fields that are in the parent, including fields that users have added.

If Inherits is FALSE or absent and the parent content type is a built-in type, the child content type inherits only the fields that were in the parent content type when SharePoint Foundation was installed. The child content type does not have any fie…

Creating a Custom Validator Control in .Net

The ASP .Net has its own form validation framework. This framework consists of:
Base Validation Class, the BaseValidatorASP Validation ControlsA Clientside Validation JavaScript Framework The "Base Validation Class" is the base of all validation controls and is also used to create own custom controls. If you want to create your own validation control, you have to inherit from the base class.

The ASP validation controls are basic validation controls provided by Microsoft. These are:
RequiredFieldControl: Checks an input field if its emptyCompareValidator: Compares the value of a field with another value. This can be a value in another field or a constant value.RangeValidator: Checks if the value in a form field is within a rangeRegularExpressionValidator: RegularExpression validators are used to check if the value in a control matches a pattern defined by the regular expression.CustomValidator: If none of the Validators are useful for a purpose, you can create a custom validat…

SharePoint 2010 MySite in detail

In general
The SharePoint 2010 MySite has changed in major points to the one in SharePoint 2007. The most striking renewals are probably the tagging und activity features. The user can now tag, comment and rate his sites and documents.

Since SharePoint 2010 has no longer a Shared Service Provider the MySite is now bound to the Profile Service. This means that the profile service must be running and configured before you can create a MySite.

The MySite uses a special master page, the "mysite.master", which is activated by the feature MySiteLayouts and uploaded to the master page gallery of the MySite sitecollection. It's relatively easy to change and switch the masterpage either by hand or by feature. The sitecollection administrator can upload a masterpage to the masterpage gallery and easily switch the master.

The good news for the frontend engineer is that the new mysite.master consists mostly of div layouts, so it
is easier to style by css. But in generally it is more…

How to style the SharePoint "Site Actions Menu" with Firebug

The site actions menu in SharePoint is generated automatically by JavaScript so you cannot look at the source code which classes are used to style the menu. I often use Firebug to check the classes and manipulate on the fly the css. But this is hard to do with the site actions menu because it disapears after a while.

A little trick helps here (works in SP2010 and SP2007)

Open the site in Firefox and open Firebug. Click the selection arrow and select the "Site Action" menu.

You will see a html code like show above. An <a> Tag surrounded by a <span> or <div>.

The trick is to copy the onclick code of the <span> or <div> tag. The javascript code can vary in each enviroment. The code can be easily copied from firebug or from the html code. In my case the code is:

In SP 2010
CoreInvoke('MMU_Open',byid('zz8_FeatureMenuTemplate1'), MMU_GetMenuFromClientId('zz16_SiteActionsMenu'),event,false, null, 0); return false;
In SP 2007

No Scrollbar in SharePoint Dialog

Today I had a strange CSS issue. The SharePoint 2010 dialog had no scrollbars anymore. I found out that this was cought by the styles of the body element.

body {width:100%;height:100%;overflow:hidden}

Yes the overflow:hidden caused that the wrapper div could not determine the height. So I checked the html of the site within the dialog and found out that there is an attribute "tabindex" in the body tag.

You can use this attribute to override the overflow style and the scrolbars are back.

body[tabindex] {overflow:auto }

Documentation of C# Code with SandCastle and Visual Studio 2010

In this post I'll show you, how you can create a documention of your code. In the past ndoc was the tool to create code docus but the project seems to be dead. Therefore we use SandCastle, a freeware tool, that is also used by Microsoft to create Code-Documentations.

Here is the reference of the comments within visual studio:

First of all you need to install these things in the given order.

Download and install SandCastle and install SandCastle Help File Builder (shfb). This is a gui for SandBox. Sandbox is mostly a command line driven tool, with a poor gui. This tool helps to create the documentation easier. you want to create MS specific .chm (Compiled Html Help) files, download and install htmphelp.exe.…

HttpModule to check the performance of a (sharepoint) site

I want to share the code of a http module I made for checking the performance of the backend site creation process. The result indicates if the site will break down when its launched and used by tausends of people. You can leave this module in your solution and activate it everytime you have to check the performance of a webpart or control. The module is simply activated by inserting an entry in the web.config.

When you type perf=1 in the querystring (ex. than a little yellow div will appear on the upper left corner, that displays the information.

First we create a new class and implent the IHttpModule interface. We implement the init method, which is the starting point.There we have to create two delegates, that process the request.

In an other class we implement the PerformanceFilter to manipulate the outputstream of the request. Here we read the stream an place a div with the information when we find the </body> tag

1: using Sys…