RSS

Programming Lists using CAML in SharePoint 2010. Create List based on a Content Type.

Comments 11/4/2011 7:25:54 AM / Posted by Eugene Martynov in Software Development

This article describes how to programming lists using CAML in SharePoint 2010. Examples were also taken from PluralSight site.

Creating List based on a Content Type using CAML:

  1. Use the SharePoint project from previous article and add new List Definition from Content Type.
  2. Choose the display name and select the Author content type (from previous article)
  3. ...

Tags: sharepoint 2010

Programming Lists using CAML in SharePoint 2010. Create Content Type.

Comments 11/4/2011 7:01:41 AM / Posted by Eugene Martynov in Software Development

This article describes how to programming lists using CAML in SharePoint 2010. Examples were also taken from PluralSight site.

Creating Content Types using CAML:

  1. Create new SharePoint project and add new Empty Element.
  2. Call the element as SiteColumns and field elements. Code can be taken from a server explorer if a SharePoint site already has a prototype of the list. Field ID values should be changed (Generate GUID tool can be used)
  3. ...

Tags: sharepoint 2010

Programming Lists using CAML in SharePoint 2010. Create List.

Comments 11/4/2011 6:29:57 AM / Posted by Eugene Martynov in Software Development

This article describes how to programming lists using CAML in SharePoint 2010. Examples were also taken from PluralSight site.

Let’s start from simple and create a list:

  1. Create new SharePoint project and add new List Definition (not Instance).
  2. Input the display name: Authors and select the Custom List type. Enable checkbox for Add a list instance.
  3. ...

Tags: sharepoint 2010

Programming Lists using Code in SharePoint 2010

Comments 11/3/2011 5:33:37 AM / Posted by Eugene Martynov in Software Development

I continue to examine the SharePoint 2010 and today I want to note how to programming lists using code. There are two approaches: programming lists using code and CAML. CAML will be described in the next article.

Examples listed below are designed for Console Application.

1. Create List:

private static void CreateList(string listName)
		{
			using (var site = new SPSite(SiteUrl))
			{
				var web = site.RootWeb;

				var listId = web.Lists.Add(listName, string.Empty, SPListTemplateType.GenericList);
				var list = web.Lists[listId];
				..............
			}
		}

Tags: sharepoint 2010

Updating web part properties through the layout in SharePoint 2010

Comments 10/27/2011 12:31:12 PM / Posted by Eugene Martynov in Software Development

I do not like the standard web part editor (Edit Web Part) in SharePoint 2010. It breaks page layout, it makes post back refreshing the whole page and so on… In this article I want to show how to update web part properties through the web part representation without web part editor.

Let’s make the following functionality:

-          Content manager adds web part to a page;

-          Content manager opens web part editor (Edit Web Part) and adds the list of values;

-          User, that has not privileges to edit the web part, chooses the values from the list using the frontend interface.

-          The Web Part saves values chosen by the users.

Tags: asp.net , sharepoint 2010 , ajax , requestdigest

Copyright © 2011 Eugene Martynov, CSS Templates by Inf Design