Stu Pegg
  • Member for 11 years, 4 months
  • Last seen more than 2 years ago
How do I convert SPUser to SPFieldUser?
Accepted answer
25 votes

It sounds like you've gotten two concepts slightly muddled. There are three entities that are important here: A field/column on a list (SPField and its derivatives, including SPFieldUser) A row of ...

View answer
Understanding Data Sheet view list better in SharePoint 2010
Accepted answer
22 votes

No No No No No No Yes, apparently: Create a view and select a Sort By column, then set that view as the default view The DataSheet view does not play ball. The problem is that the DataSheet view ...

View answer
How to programatically determine if 2013 running in '14 compatibility mode' (SP 2010)
Accepted answer
8 votes

You can check SPWeb.UIVersion to see what UI version the site is currently using: switch(web.UIVersion) { case 3: // 2007 break; case 4: // 2010 & 2013 "14 mode" ...

View answer
Is it possible to launch a modal that doesn't have the IsDlg property?
7 votes

Following on from James's answer, the html option of showModalDialog allows you to directly send html to be rendered in the dialog. Unfortunately it accepts an HTML DOM object rather than an HTML ...

View answer
Calculated field Date formula
Accepted answer
7 votes

I believe the date/time format you are looking for is: "dd mmm yyyy h:mm AM/PM" This may be useful: TEXT function reference

View answer
How do I enable a greyed out datasheet button?
7 votes

Just on the off chance: You are using Internet Explorer, right? If not, I'm afraid this is an IE-specific function; as I discovered when trying to pry it open with Chrome's dev tools.

View answer
Efficiently determine if a List is using item level security
Accepted answer
6 votes

Leading on from @tylerrrr07's answer, there's another overload of GetItemsWithUniquePermissions which may be of use to you: MSDN: SPList.GetItemsWithUniquePermissions Method (int maxItemToReturn, ...

View answer
How to query using CAML when a value has < in the value
Accepted answer
6 votes

My advice would be to use the CDATA escape, rather than replacing the offending characters one by one: <Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text"><!...

View answer
Multiple Sharepoint projects in one solution - how to package correctly?
5 votes

Our way around this is to use ILMerge. The common assembly is merged into the other assemblies post-build, avoiding problems with different assembly versions (less of a problem in your case) and ...

View answer
How can I display a message on a list item when within X days of a date?
5 votes

Partly inspired by this question, and partly because we developed a product that has this functionality, I've written a blog post (linked at the bottom) on how to achieve this. The summary is: ...

View answer
70-576 Study Material
Accepted answer
5 votes

I've done a little digging this afternoon, and found the following from Pedro Pinto. It seems quite comprehensive so far, if understandably vague (given the depth of the subject). It needs an editor'...

View answer
CAML Query throwing error
4 votes

You've got a missing < before your first Value> and a misplaced <And> between the <Eq> and <Geq> that should be after the </Geq>. <Where> <And> ...

View answer
Calculated Hyperlink Column - Lost ID-Field Value Upon Editing
4 votes

Unfortunately [ID] isn't actually a supported field in calculated columns. When a new item's values are being processed it doesn't yet have an ID, so the calculated field has nothing to work with. ...

View answer
When using Sharepoint Client Model I get error : The 'Contains' member cannot be used in the expression
4 votes

Unfortunately this is a limitation of LINQ. I've had exactly the same error when using LINQ to SQL. The problem is that LINQ only knows how to map certain operations. We can see string.Contains() and ...

View answer
Caml to get today's birthdays
4 votes

Edit: Doesn't actually work; possibly due to issues between <In> and DateTimes. Ready for some madness? This is an ungodly and unmaintainable solution, but it's worth it for the laugh: <In&...

View answer
How do I programmatically set up branching logic in SharePoint survey list?
Accepted answer
4 votes

Well, it was an epic adventure into lands unknown, and I may have found your answer. First of all, some background: Questions on a survey are represented by fields in a list (they all inherit from ...

View answer
How do I hide the "Datasheet view" option in a list?
4 votes

In addition to Steve B's solution, another 2010-only way of doing this is to set the following property to true: SPList.DisableGridEditing Unfortunately there appears to be no way to do this in 2007....

View answer
Override the custom field rendering in a list view
4 votes

@Marek is right in his assertion that you should use XSLT. However, in 2010 (only) there are functions you can override to alter a field's output: GetFieldValueAsText is used by most field types for ...

View answer
Can I use OAuth without an app?
Accepted answer
3 votes

Having learned a fair bit about OAuth in Office 365 since I posted the question, I can now answer myself: No, you cannot use OAuth without an app. However, in on-premise solutions you can set up a ...

View answer
How to aggregate events from multiple calendars to master calendar?
3 votes

In 2010 calendars have a built-in "Calendars Overlay" function under the Calendar tab. This allows you to display information from other calendars on the current view. Bjørn Furuknap has an article ...

View answer
Using the ItemAdding EventReceiver to update multiple fields based on values from one field
Accepted answer
3 votes

It sounds like you're using the ItemUpdated event. If you used ItemUpdating I believe you could modify the AfterProperties instead of performing a second update. This may be of use to you: NBSP: ...

View answer
What features have been lost in SharePoint 2013?
3 votes

Installing SP2013 on Windows 7 or 8 for development purposes is not supported: We support installation of SharePoint 2013 only on Windows Server 2008 R2 Service Pack 1 x64 or Windows Server 2012. ...

View answer
how to find Imported web
Accepted answer
3 votes

I'd recommend using SharePoint Manager to check everything's where it should be.

View answer
Trying to hide the title column the sharepoint way
Accepted answer
3 votes

Trying to change the display name of the Title is going to be an uphill struggle: There are several versions of the same column, each with their own DisplayName (some of which are created in the list)....

View answer
How do I get started with developing a custom web service in SharePoint?
Accepted answer
3 votes

Below are a few links you may find useful. Unfortunately this is a very broad question, so it isn't possible to include all the details here. Tutorials MSDN Walkthrough for a basic web service: ...

View answer
How can I get a count of all documents in all site collections?
Accepted answer
3 votes

If you're talking about using the Object Model, then I'd recommend SPSiteDataQuery. It has many options for filtering the results, including by list template (e.g. document library).

View answer
How do I disable\stop or enable\start Sharepoint 2010 on my Windows 7 development machine
3 votes

I use SharePoint 2010 Service Manager to stop and start the SharePoint services: CodePlex: SharePoint 2010 Service Manager There's even a button at the bottom to prevent SharePoint from starting on ...

View answer
show custom dialog on menuitemtemplate click
3 votes

JavaScript is case sensitive, and you're also missing a comma in the options. This should work better: menuitemtemplate.ClientOnClickNavigateUrl ="javascript:SP.UI.ModalDialog.showModalDialog({url:'...

View answer
Using an Additional Lookup Column Value in a Calculated Column
Accepted answer
3 votes

Unfortunately you're only able to use the following field types in a calculated field formula: Yes/No Calculated (as long as it isn't the current one) Choice Number/Currency DateTime Text Lookups ...

View answer
URL in calculated column
Accepted answer
3 votes

We've recently released a free HTML Calculated Column; it acts just like a calculated column, but won't escape HTML: Pentalogic's SharePoint HTML Calculated Column To produce a clickable link, you'd ...

View answer