Article archive
Modify custom properties toolpart order
05/10/2012 23:23
//Override GetToolParts method in web part class
public override ToolPart[] GetToolParts()
{
//Get all toolparts
ToolPart[] toolparts =...
Field validation in schema.xml
05/10/2012 18:24
Defined in schema.xml
//In case we want to have it empty or valid value - but we don't want to have this field required.
<Field ID="{402F153D-F596-43E6-9A24-7FE9AD2647B6}" DisplayName="Default Video Width"...
Field types
05/10/2012 18:21
Sharepoint Field Types - Elements.xml
taken from
https://sharpointpractice.blogspot.sk/2011/08/sharepoint-field-types-elementsxml.html
Single Line of Text: Text
field id="{FDDC4E38-25E0-4FD9-92E7-D17F34A5AB12}" description="My Content ID of Item" staticname="ContentID"...
Activate Developer Dashboard
04/10/2012 11:54
#If this script doesn't work, start Sharepoint Web Services application pool
#Load assemblies (if sharepoint snappin is not...
Access modifiers
30/09/2012 11:05
Access modifiers
public
The type or member can be accessed by any other code in the same assembly or another assembly that references it.
private
The type or member can only be accessed by code in the same class or struct.
protected
The type or...
Query Sharepoint List
29/09/2012 20:37
//Query SharePoint list by CAML query, Linq, lambda expression
using System;
using System.Linq;
using Microsoft.SharePoint;
SPList list = web.Lists["Lookup...
Lambda expressions examples
29/09/2012 18:38
//Get termstore groups count with 'groupName
var count = termStore.Groups.Count(grp => grp.Name.Equals(groupName));
var MySubCollection = MyCollection.Where(x => x.IntegerProperty > 5);
(input parameters) => expression
(x, y) => x ==...
Call private method from abstract class
27/09/2012 21:44
Using System.Linq;
public object InvokePrivate<T> (T instance, string methodName, params object[] obj)
{
var baseType = instance.GetType().BaseType;
...
Get protected property value
27/09/2012 21:43
//Create help public class
public class Class1 : MultiPageNavigationController
{
public Class1(INavigationConfiguration config) : base(config)
{
}
//create method to get...
Toolpart Save Exception
27/09/2012 21:20
//Validation in custom Toolpart can be done by firing exception in override ApplyChanges method of Toolpart.
if(string.IsNullOrEmpty(this.txbConfirmationPageUrl.Text))
{
throw new Microsoft.SharePoint.WebPartPages.WebPartPageUserException("Custom...
Items: 301 - 310 of 384