Kentico CMS 7.0 Developer's Guide

Web parts

Web parts

Previous topic Next topic Mail us feedback on this topic!  

Web parts

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

Web parts for connecting to SharePoint are stored in the Microsoft SharePoint category in the web part catalog. This includes the following four web parts:


SharePoint datasource

SharePoint datagrid

SharePoint datalist

SharePoint repeater


The following text contains information about the specific properties of these web parts.




The following properties can be configured in the SharePoint section. All the web parts listed above have these settings in common.


Mode - determines what the web part will do (what data will be retrieved from the SharePoint server) and therefore which web service should be used.

SharePoint site URL - specifies the URL of the SharePoint site that should be used. Based on the value of the Mode property, the full URL of the required web service is determined by this option (it is not configured directly).

Username, Password - you can specify the username and password for authentication directly in the web part properties, or you can inherit global values from Site Manager -> Settings -> Integration -> Microsoft SharePoint. If you want to use the credentials from the Site Manager settings, leave the fields empty.

List name - if you use the Display list items or Display list of pictures options, you must specify the list from which the items should be loaded. In the other two modes, you can leave it empty. Please note: this field is case sensitive.


Just these settings should make the SharePoint datagrid display data or the SharePoint datasource to provide them. The other two web parts still need to have a transformation specified.






The SharePoint datalist and SharePoint repeater need to have a transformation specified in order to display the retrieved data.


There is a number of pre-defined transformations which you can use almost right-off and of course modify them according to your needs. The transformations are stored under the SharePoint - Transformations document type (can be edited in Site Manager -> Development -> Document types). Their names are self-explaining - they correspond to what they should be used for.


The only thing you need to do to get them to work is edit (Edit) them and replace the sample server or field names with the real names used on the SharePoint server.




In the Advanced section, you can specify (limit) in more detail what you want to retrieve. These settings are applied only in the “Get list items” mode.


Row limit - sets the maximum number of retrieved items.

Query - filters or sorts the returned items. Its purpose is similar to that of a WHERE condition in SQL, but it has completely different syntax based on CAML. For more information on how to construct such queries, search SharePoint documentation or use Google with keywords like “SharePoint query”.

View fields - directly specifies which fields (columns) of a SharePoint list should be retrieved.




In this section, you can control how the retrieved data will be processed and displayed.


Selected item querystring key name - if entered, items will be selected based on the presence of this key in the URL query string.

Selected item field name - allows you to specify the field that is used to select items. The default approach is to select items by ID — the web part tries to get the query string parameter specified in the Selected item querystring key property and uses its value, e.g. If you entered id into the property above, aspx?id=2 will select the item with 2 in its ID field. Note: the original field name is used here — without the ows_ prefix. This field is case sensitive.

Selected item field type - specifies the type of the ItemID field. For IDs, you should use the Counter type, for strings, use the Text type. These two should be sufficient for most cases, but you can search SharePoint documentation for other types.

Use dataset - if enabled, the retrieved XML data will be converted to a dataset that can be used with standard ASCX transformations. If disabled, the data will not be modified and can be converted directly to HTML using XSLT.

Dataset fields - if you want to use the dataset format, but you don’t need all fields, you can specify which fields should be included in the dataset by entering their names separated by semicolons. This property can be particularly useful if you want to use caching.


Please note: Properties in the Display section are not available for the SharePoint datagrid web part.




Because it is sometimes hard to tell or remember how SharePoint addresses list fields, we implemented the Show raw response function. It displays all retrieved SharePoint data in its raw XML form. You can look for fields which contain valuable information and can be displayed. Note: if the data is fetched from the cache, the response can’t be printed.