Archive for Sharepoint

The Expert News Rotator Webpart: Now Available

// July 6th, 2009 // 8 Comments » // Sharepoint

The Expert News Rotator is a Sharepoint webpart based off the jQuery Image Rotator with the ability to scroll through content in an Announcements List.

1. Images per news item
2. Thumbnails for each news item
3. Limit Number of news Items
4. Items filtered by Sharepoint Views

Check out my codeplex release for more details…

Sharepointings Hands on Labs in Sydney

// May 10th, 2009 // No Comments » // Sharepoint

Well busy preparing for my Hands-on-labs for Tuesday, this will be the fourth one im doing this year and i suppose im starting to become pretty used to standing up and unloading MOSS and its features in a mere 20 minutes…

My disclaimer is always something along the lines of me explaining that demoing all the features of MOSS in twenty minutes is damn near impossible, but 25 minutes later im always waved to politely from the back of the training labs… Courtenay, you’re way too overexcited about Document Management or Business Intelligence or one of my ramblings.

Nonetheless i get excited about these training days since we get to do some hands on labs with some of key prospects. Hands on labs are an exciting way to learn anything really. Well on Tuesday 12 May 2009 you can get your hands dirty by building some Microsoft Infopath forms and strapping some workflow onto the back of it!

You need to register for the event and there are still spaces open. Its free some come on and try it out!

Email: craig.panigiris at pa.com.au
When: 12 May 2009
Where: 124 Walker Street, North Sydney, Sydney

Sharepoint lookups over 20 items solution?

// May 7th, 2009 // 6 Comments » // Sharepoint

Came up with a super frustrating “by design” issue today which baffled me for hours.

The Problem

Ok, so i admit. I have a lookup on a Manaufacturers list which grabs me a list of cars (not really but we’ll use the example for simplicity). Ive built a custom list form and some “dodgy javascript” such that i can select the correct car in the Cars list when the New Form opens using the CARID querystring item. All worked perfectly until i hit 20 Cars!

Yes i admit that dodgy javascript isnt correct, but doesnt anyone find it a little strange that after 20 items, the lookup changes to a weird “input” type of control? Well that obviously broke my javascript. I needed a way to maintain the dropdownlist such that the javascript would keep filtering based on CARID.

The Solution

I sorta knew what i needed to do with this problem. I needed to change the Sharepoint:FormField item, i just didnt know how. After a LOAD of testing i came up with this. Ill try to document my changes as best as possible.

1. Your current lookup field in your custom list form probably looks something like this:

<SharePoint:FormField runat="server" id="ff9{$Pos}" ControlMode="New" FieldName="Related_x0020_Car" __designer:bind="{ddwrt:DataBind('i',concat('ff9',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Related_x0020_Car')}"/><br />

Do these steps in order otherwise this wont work

2. In the datasources add in the following datasource. Be careful to tell the datasource exactly what you are looking for:

a) change the DefaultValue attribute below to the name of your lookup list

<SharePoint:SPDataSource id="Cars1" runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="&lt;View&gt;&lt;/View&gt;"><SelectParameters><br /> <WebPartPages:DataFormParameter Name="ListName" ParameterKey="ListName" PropertyName="ParameterValues" DefaultValue="Cars"/><br /> </SelectParameters><br /> </SharePoint:SPDataSource>

3. Change the <SharePoint:FormField> to <SharePoint:DVDropDownList>

3. Add in the following attributes:

DataSourceID=”Cars1″
DataTextField=”Title” – the name of the column you lookup to
DataValueField=”ID”
SelectedValue=”{@Related_x0020_Car}” – the name of your lookup column

4. Remove

ControlMode
FieldName

5. Change
__designer:bind="{ddwrt:DataBind('i',concat('ff9',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Related_x0020_Car')}"

to

__designer:bind="{ddwrt:DataBind('i',concat('ff9',$Pos),'SelectedValue','SelectedIndexChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Related_x0020_Car')}"

where ‘i’ in the databind is for insert, i think ‘u’ is for update on editing forms
also, remember to use the correct id, mine is “ff9″ here but you may be different.

5. Thats it, should be done. It should now render as a dropdown which you can choose once again.

Hope this helped!

How to use the PeopleEditor Control (People Picker)

// February 17th, 2009 // 1 Comment » // Sharepoint

After trawling many blogs i thought i might aggregate the posts ive found to create an all-in-one post on how to create, retrieve values from and update a PeopleEditor Control programmatically. Thanks to the following two blog posts with the ideas and some code in creating my post:

1. How to use the PeoplePicker in Sharepoint
2. Using SharePoint controls in your own forms – PeopleEditor control

1. Creating

To Create the control in your ascx file, first add the Register tag:

@ Register TagPrefix="SharePointSD" Namespace="Microsoft.SharePoint.WebControls"<br /> Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,<br /> PublicKeyToken=71e9bce111e9429c"

And the control itself:

sharepointsd:peopleeditor runat="server" id="txtManager" xmlns:sharepoint="#unknown"<br /> autopostback="true" allowempty="false" selectionset="User,SecGroup,SPGroup" borderwidth="1"<br /> width="200px" placebuttonsunderentityeditor="false" rows="1" /

2. Retrieving Value

<br /> private string GetPeoplePickerValue()<br /> {<br /> string strAccountName = String.Empty;<br /> for (int i = 0; i < txtPerson.ResolvedEntities.Count; i++)<br /> {<br /> PickerEntity objEntity = (PickerEntity)txtPerson.ResolvedEntities[i];<br /> SPUserInfo objInfo = new SPUserInfo();<br /> objInfo.LoginName = objEntity.Key;<br /> //strAccountName = objInfo.LoginName;<br /> // to return a sharepoint people group formatted string use...<br /> strAccountName = objEntity.EntityData["SPUserID"].ToString() + ";#" + objEntity.DisplayText.ToString();<br /> }<br /> return strAccountName;<br /> }

2. Populating Values
<br /> public void FillPeopleEditorControl(string strUserId, PeopleEditor peopleEditorControl)<br /> {<br /> try<br /> {<br /> if (!String.IsNullOrEmpty(strUserId))<br /> {<br /> strUserId = strUserId.Substring(0, strUserId.IndexOf(";"));<br /> SPUser SelectedUser = SPContext.Current.Web.AllUsers.GetByID(Convert.ToInt16(strUserId));</p> <p> PickerEntity pe = new PickerEntity();<br /> pe.Key = SelectedUser.LoginName;<br /> pe = peopleEditorControl.ValidateEntity(pe);</p> <p> peopleEditorControl.Entities.Add(pe);<br /> }<br /> }<br /> catch (Exception ex)<br /> {<br /> lblError.Text = ex.Message;<br /> }<br /> }

Solution: “No item exists at” “It may have been deleted or renamed”

// February 17th, 2009 // No Comments » // Sharepoint

Using a dataview or custom feature, you may have come accross this error. It is because you are using the reserved querystring “ID” in your querystring.

Use ItemID or anything different!

Feature Stapling in Sharepoint: Meeting Workspaces

// February 10th, 2009 // 1 Comment » // Sharepoint

I see feature stapling as an extension to the standard features, which allow you to make modifications or add functionality to a site after it has been created. It is the best way to extend Sharepoint functionality and is the supported way to make changes to any existing sites.

Recently i came up with a problem of how I would Change the masterpage of a particular Workspace (actually a meeting workspace attached to an events list). Chris Johnson’s Feature Stapling Article helped me to do just this. As he explains, you can make modifications to any site using a feature and simply stapling it to a site. Heres how i did it!

 

  1. First create a new WSPBuilder Project in Visual Studio
  2. Create folder structure as detailed below:

  3. Open your class file, mine is BardEventsWorkspace.cs, it should be similar to this below. Don’t forget to use Microsoft.SharePoint.Navigation;

  4. Open BardEventWorkspace folder and open the feature.xml. It should look similar to the following:

     

  5. Open the BardEventsWorkspaceStapler folder and open the elements.xml. It should look similar to the following:

     

    Each one of the “FeatureSiteTemplateAssociation” nodes represents the site which I want to staple the original feature to. In this case it’s all the meeting workspaces. Also the Id should be the same as the feature. In this case “2B3451F0-BC93-41A4-9FAD-3A81861D651A”. See step 4.

     

  6. Open the BardEventsWorkspaceStapler folder and open the feature.xml. It should look similar to the following:

     

  7. On your solution, right click your solution and click “WSPBuilder” then “Build WSP” as shown below:

     

  8. Using the Sharepoint Installer Project, add your WSP to the folder and change the setup.exe.config such that it is similar to the screenshot below:

  9. Deploy!

MOSS, Infopath Forms and Workflow training

// February 5th, 2009 // No Comments » // Sharepoint

Recently i was asked to do some Hands on Labs for Training on Forms and Workflow amongst other things. I wrote a short Hands on Lab document which covers the use of Microsoft Infopath 2007, Microsoft Sharepoint Server 2007 (MOSS) and Microsoft Sharepoint Designer.

In the lab, you will use Microsoft Office InfoPath 2007 to create an out of the box Travel Request form and publish to SharePoint document library. You will create a submit button from the Controls section of Infopath and configure it to submit to your document library. You will then create a workflow in Sharepoint Designer and attach it to Travel Request form library. Within the workflow, you will use out-of-the-box actions such as assigning a task or sending an e-mail message.

The audience is mostly for business process owners or Sharepoint rookies getting the hang of the whole process.

here

WSS Site Templates

// January 28th, 2009 // No Comments » // Sharepoint

Essentially a quick start to start branding WSS, these templates will give you a look and feel similar to below:

This look and feel incorporates a custom navigation, company banner across the top and some webpart template changes.

Make sure you:

1. Add the Masterpage to the _catalog/masterpages directory
2. Add the images to the home site /images folder

And here are the files:

1. Images
2. Template – CSS and Masterpage

I use this template at all my clients and then insert a banner for them and perhaps change colors.

my 2009

// January 5th, 2009 // 1 Comment » // My Life, Sharepoint

So in january last year i posted a little to do list for 2008. Two amazing things happened in 2008 to make it the best year of my life, but also not much getting completed!

1. i moved to australia to work
2. i met the girl of my dreams

These took a lot of time up in adjusting to a new country and well… girls will always take a lot of time. Some of the things im most proud of in 2008 were which were on my list:

1. Learning to kiteboard
2. running 389km in total
3. learning guitar properly, now i need to practice it!
4. a little salsa dancing with my new lady Tam
5. dived the great barrier reef.

I accomplished a lot last year including setting up a home and some sort of life in Sydney, Australia. This took a lot of hard work. In the last 8 months of my living in australia i feel i have setup nicely and i want to expand my horizons here in the land down under. Some of my goals and wishes for 2009 include:

1. focus on business opportunity: generate a secondary income stream to help me pay off some home loan debt
2. plan my 6 month world travel for 2010
3. do a backflip with my kite
4. buy a car in australia
5. become a sharepoint MVP

Im just limiting them for now, 2008 taught me that i shouldnt try to take too much on… and with that its back to work!

The Expert Calendar: Video

// November 30th, 2008 // No Comments » // Sharepoint

The expert calendar in action below. Thanks to Sharepoint Reviews for listing my webpart here: