Article archive
SPGridView filter not working
04/06/2015 17:43
- SPGridView connected to datasource, but filter was not applied even if it was there.- By comparing two examples I have found following difference in .designer file generated by Visual StudioWhen I commented out first row and added row below, filter suddenly started to...
Create Custom action
03/06/2015 17:22
Custom action as link to Settings.aspx to our custom Application page- Add Module element in Visual Studio- Remove Sample.txt- Make sure Module is present in correct feature- Modify Elements.xml as following<?xml version="1.0" encoding="utf-8"?><Elements...
Create taxonomy field programatically
03/06/2015 16:38
This code creates taxonomy field (hidden note field is also created by sharepoint)- Add reference Microsoft.SharePoint.Taxonomy- add using System.Linq;- Use your own Logging class- field.IsPathRendered = true; setting is not needed, it was our customer request public static TaxonomyField...
Set Sharepoint Url field
02/06/2015 10:07
SPListItem item = list.GetItemById(2); string fieldName = "myFieldInternalName"; SPField urlField = item.Fields.TryGetFieldByStaticName(fieldName); if (urlField != null) { SPFieldUrlValue urlValue = new SPFieldUrlValue(); urlValue.Url =...
Custom action content type binding not working
18/05/2015 10:18
I had issue with binding following action to content type, it was not working as expected. I used web feature and I tried to use content type id value generated by Visual Studio. I found some articles for this issue and it was generally about capital letters in content type id. Here is the list of...
Sharepoint Timer Job configuration
14/05/2015 14:43
Option configuration file OWSTIMER.EXE.CONFIG1. Open OWSTIMER.EXE.CONFIG file in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN2. Add appSettings node to configuration node3. Modify your code, add reference to System.Configuration.dll and use call string...
SharePoint List Helper class
12/05/2015 11:53
This class is used for common list item operation, get or set the value to/from list item safely
- Create ListHelper.cs class in your project
- copy and paste following class definition
- this class uses Logging.cs file, but if you have your own logger, just update appropriate method...
SharePoint Logging class
12/05/2015 11:34
Here is the content of Logging.cs file, basic SharePoint logging- Add new class to your project, name it Logging.cs- Copy following text into it (replace only class definition, leave your namespace as it is)using Microsoft.SharePoint.Administration;using System;namespace...
Find file in SharePoint list by Powershell
11/05/2015 11:20
#Find file / document in sharepoint list by document nameAdd-PSSnapin microsoft.sharepoint.powershell$web = get-spweb 'https://yoursitecollection'$list = $web.Lists.TryGetList('Your Doc library');$query = new-object microsoft.sharepoint.spquery;$query.Query = "<Where><Eq><FieldRef...
Add additional lookup field by Powershell
06/05/2015 11:40
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue$web = get-spweb "https://yoursitecollection"#in this $list, we already have main lookup field to $targetList#we want to create additional lookup to show more information from $targetList$list = $web.Lists.TryGetList("My...
Items: 81 - 90 of 384