The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.
Here’s an excerpt:
The concert hall at the Syndey Opera House holds 2,700 people. This blog was viewed about 14,000 times in 2011. If it were a concert at Sydney Opera House, it would take about 5 sold-out performances for that many people to see it.
Had this exception thrown while enumerating SPListCollection within a SPWeb. Full exception error is as below.
Unhandled Exception: System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at Microsoft.SharePoint.SPBaseCollection.SPEnumerator.System.Collections.IEnumerator.MoveNext() Collection was modified IEnumeration error
I changed my code from a foreach to a for and it worked hassle free.
// code goes here
Unfortunately, this does not work as intended for me. Especially in cases where I had to work on SharePoint. In order to overcome it, I used the window.load instead. See below:
// code goes here
This example shows you how to delete a row from your SPGridView control.
Note the two events OnRowDataBound and OnRowDeleting on the control, and also pay attention to the DataKeyNames property.
I’ve also used TemplateField, and added in a LinkButton for Delete. Note the CommandName and CommandArgument properties.
Essentially, in this example I’ve bound a collection of items (SPListItem) from a particular list (SPList). The CommandArgument evaluates the Title of the list item that is also part of the bound collection.
And on the OnRowDeleting event, I’ve retrieved the list item (SPListItem) title from the particular row using the RowIndex.
This is quite a common error when developing custom field types on SharePoint. Few quick points to keep an eye for, and they are:
- Ensure that the field type matches the parent type – for example, if you inherit from SPFieldText then ensure that the ParentType attribute on the fldtypes_<fieldname>.xml file has the value of Text.
- Ensure that you do not clash with SharePoint Internal names – this can be easily avoided by having a standard naming standard for your SharePoint development. I tend to prefix my custom field names with HM, example would be HM<fieldname>.
- Ensure that the FieldTypeClass is specified correctly – on the fldtypes_<fieldname>.xml file, ensure that the FieldTypeClass attribute is specified correctly. Should be specified as “namespace.classname, assembly name, version, culture, publickeytoken”
Need to retrieve user information, such as email from a PickerEntity control? The code snippet below shows you how to, for this example get the user email.
Do note, I also have a post on how to do this from a People and Group field here.
Ever had to retrieve user information from a Person or Group field? In my case, I had to get the user email, and the code snippets below shows you how.
If the field has been set to only allow single selection such as
the use the following:
Where oItem is the SPListItem object, and [“Manager”] is the field display name.
However, if the field has been set to allow multi-selection such as
then use the following:
Where oItem is the SPListItem object and [“Team”] is the field display name. And sb being a StringBuilder object that I’ve used for this purpose.
I was using the SPGridView control and had a particular SPListItemCollection as my data source. My data binding works fine, but I get the "One of more field types are not installed properly” error on GridViewRowDataBound event.
This was strange because I was casting the right fields and also made sure that they weren’t null. After spending considerable amount of time looking at this I found the culprit. It was my data source CAML query. Have a look at it below:
Have you found my error? If you have, then you’ve been CAMLing to much . Well below is my updated working query:
Do you see my error now? Yup, I had used U2U’s CAML builder and then copied the query and pasted it in. Unfortunately, I had forgotten to remove the <Query></Query> elements from it. Remember, it’s not needed when you use the SPQuery object.
Hope this saves you valuable time.
I had to add a couple of custom web parts to a clean and plain site page and realised I had forgotten the URL to get into edit mode. Remember, the page is plain with no Edit Page links and such. Thankfully, I found this post by Daniel McPherson that had a listing of just what I needed, which was to append the page URL with ?PageView=Shared&ToolPaneView=2
Nice to have such resources available when you need them
I got the following error (see below) after deploying and Ajax based web part to a SharePoint 2007 (yikes!) server.
I had manually made the required web.config entries earlier, and the web part by itself does not really do anything funky. It consisted of a ScriptManager, an UpdatePanel and a ProgressPanel. Looking around I realised that there was no problem with it prior to OnPreRender.
Following this forum thread I got to resolve the issue. Essentially, make sure the EnsureChildControls() is called on OnInit(), as below:
protected override void OnInit(EventArgs e)