Subscribe:      
 

Converting a SharePoint Custom List View Web Parts into an XSLT Data View Web Parts - Part 1

Written By: Hesham Saad -- 1/27/2011 -- join -- contribute -- (252) comments -- printer friendly version

Rating: Rate --

Categories: Configurations, Design, MOSS 2007, WSS3

< Prev - 1 | 2 | - Next > | Become a paid author

Problem

Many SharePoint portals require extending SharePoint OOB (Out Of The Box) Web Parts. This can lead to the development of custom coded Web Parts. This can be achieved by customizing and converting SharePoint Custom List View Web Parts into XSLT Data View Web Parts.

Solution

This solution uses an XSLT DataView.

XSLT "Extensible Stylesheet Language Transformations" is a language for transforming XML documents into other types of documents , such as HTML or XML. It is designed for use as part of XSL which is a style sheet language for XML and also designed to be used independently of XSL.

A DataView is a live, customizable view of a data source that leverages Microsoft's ASP.NET technology that presents views of data that can you filter, sort, or group. You can also change the layout, apply styles or apply conditional formatting in a WYSIWYG environment. A DataView can display data from a wide variety of sources and be modified by using Office SharePoint Designer. These include:  

  • Databases queries.
  • XML documents.
  • Web services.
  • SharePoint list & libraries.
  • SeServer - side scripts.

So, a combination between XSLT and a DataView is a great way to modify the look and feel of displayed data in a SharePoint site in order to match your requirements. This will save time and help many non-SharePoint developers users to enhance the look and feel of their Web Parts without writing a single line of code.


 In this article (Part-1), you will see how to prepare for "Converting SharePoint Custom List View Web Part into XSLT Data View Web Part" by creating the custom list and displaying the page.

 In Part (2), you will see how to create a simple XSLT DataView for a SharePoint custom list.

Create a List and fill it with data

First, let's create a SharePoint custom list "MSSharePointTips - News" and fill it with some sample data:

Note:  This tip uses a publishing site.

Open your SharePoint Site, click on the "Site Actions" menu, then "Site Settings", then "Modify All Site Settings" :

1

Click on "Site Libraries and Lists" under the "Site Administration" section:

 2

Click on "Create new content" :

3


Then , Click on "Custom List" under "Custom Lists" section :

4

Type a Name for the custom list then press the Create button:

  5

Click on "List Settings" under the "Settings" menu:

6

Create a new Column called "Description". The type should be "Multiple lines of text - Plain text". Then click on "Add from existing site columns" link under the "Columns" section for adding the news image column:

11

Select the "Rollup Image" site column from the "Available site columns:" list, then press the "Add >" button to be added to the "Columns to add:" list:

13

Click on default the "All Items" view under the "Views" section in order to show/hide columns in the list default view:

    13

  - Check "Created (i.e.: News Created DateTime)" , "Rollup Image", "Title" & "Description" columns and adjust their displaying positions:

14

Click on "Column Ordering" under the "Columns" section in order to order/sort the columns in the entry form:

15

 16

Click on "New Item" under the "New" menu items toolbar in order to add a new News item "Sample News data":

17

18

Viewing the "MSSharePointTips News" list after adding a sample news list item:

19


< Prev - 1 | 2 | - Next >



Learn more about SharePoint



Sponsor Information




Copyright (c) 2010-2017 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | contribute | feedback | about
Some names and products listed are the registered trademarks of their respective owners.


MSSharePointTips.com | MSSQLTips.com