X

SharePoint

SharePoint: How to find DispForm.aspx toolbar

I needed list item display view toolbar on one of the custom forms. It wasn’t very easy to find it from many files but I found it at last. Nice to be beginner anyway.

Custom property of SharePoint web part doesn’t show up

SharePoint usually surprises me on the most busiest moments. I wrote web part that has some custom properties. These properties were simple ones and it was okay to show these properties in Miscellaneous section of web part property sheet. Although properties were defined nothing new showed up in property sheet.

SharePoint Manager 2007

One extremely useful utility for SharePoint is SharePoint Manager 2007. SPM2007 is developed by Carsten Keutmann. You may know him better by his other project – WSPBuilderthat is one of the best SharePoint add-ins for Visual Studio.

Writing messages to ULS (Unified Logging System)

If you want to make your SharePoint solution more SharePoint way you can write your tracing, debug and error messages to SharePoint log. Easiest way to do it is to write logger by yourself. Btw, SharePoint has class called ULS to write messages to logs but this class is internal and we cannot use it. But it is there.

SharePoint: Access denied error when adding new page to page library

On one of my servers I detected very weird error. There are authenticated users who can add content to some page libraries and modify pages they have made. One day suddenly they were not able to add pages to page library anymore because of Access Denied error.

SPListItemCollection.GetDataTable() – be careful

Seems like I am stuck in ADODB days a little bit and I still expect that query with no results returns at least some meta data. Or at least my code gets no bombed by null references.SPListItemCollection has GetDataTable() method that returns items collection as ADO.NETDataTable objects. Be careful when using this method – if your items collection is empty then this method returns null.

Creating cross-site lookup field in SharePoint

Cross-site lookup field is something we need almost every project that is not very small. There is no good OOTB solution but we can use field by Toby Bierman. This kind of field is easy to create because SPFieldLookup is cross-site by its nature. Basically you ave to perform the following steps.

SharePoint: temporary solution for GetCustomProperty and SetCustomProperty errors

Another day, another kinky problem with SharePoint. This time I struggled with custom properties of my custom field. I tried out different code samples to make GetCustomProperty and SetCustomProperty to work but no luck at all – nothing worked for me. There was no errors when adding field to list or changing field properties but custom properties were never saved.

Creating SharePoint global calendar

Creating global calendar that shows data from different calendars is something that SharePoint doesn’t have out-of-box. Using site data query and calendar view control we can easily create global calendar and make it show data from lists we want.

Querying SharePoint lists

The best way to get data from SharePoint lists is to query them. Using queries you guarantee that only list items you really need are retrieved from database and constructed to objects by SharePoint. Most of the time you don't need the full collection of list items, so it is not point to ask all the items and then use only few of these. Let's see how we can query SharePoint lists.