Category: SharePoint Development

SharePoint Development

Silverlight Blueprints for SharePoint

Microsoft released the source code for the Silverlight Blueprints for SharePoint—based on the Silverlight Beta 2 release. The Silverlight Blueprints for SharePoint provide a way for developers to better understand how to integrate Silverlight applications with SharePoint. Silverlight is an incredibly popular technology and with the increase in SharePoint adoption we’re finding an increased call for integrating technologies like Silverlight with SharePoint.  

In this release, you’ll find five blueprint samples:

1.       Hello World
2.       Media Player
3.       Slider Control
4.       Custom Navigation
5.       Colleague Viewer

 

Included in the release are documentation for each of the samples and the source code (go to the Releases tab of the CodePlex site). Also posted to the site is an FAQ document. In the coming days and week, we’ll publish additional screen-casts and any other supporting documentation we create or that is provided to us through the developer community.

 
The links to get to the Silverlight Blueprints for SharePoint are:

1.       http://www.ssblueprints.net/sharepoint/   –or direct at the CodePlex site
2.      
http://www.codeplex.com/SL4SP

Programmatically Create SharePoint Survey questions

Scenario

I’m seeing this question “Is there way to create SharePoint Survey questions programmatically ?” many times in SharePoint Forums and News Groups

Solution

The answer is that it’s definitely achievable programmatically through SharePoint API’s. The following snippet would help.

SPWeb web = SPControl.GetContextWeb(HttpContext.Current);

Guid surveyId = web.Lists.Add(“Name of the Title”, “Description of the survey”, SPListTemplateType.Survey);

SPList survey = web.Lists[“Survey List Name or Id];

string Question = “Question#1 for survey”;

StringCollection choices = new  StringCollection();

choices.Add(“first choice”);

choices.Add(“second choice”);

choices.Add(“third choice”);

survey.Fields.Add(Question, SPFieldType.Choice, true, false, choices);

 

 Subscribe to my post

Use Data View web part without unghosting the page

I’m wondering if it’s possible to use the data view web part available in sharepoint designer on a page without having to customize  or ‘unghost’ the page?

Yes, this is feasible and check the following steps

1. Create a sample web part page and add the dataview web part through sharepoint designer.

2. Now the sample web part page is unghosted. Export the web part from this web part page

3. Delete the sample web part page

4. Create a new web part page and import the web part

This way we can leverage the data-view web part without unghosting (or) customizing) 

 Subscribe to my post

Connected Page Viewer Web Part

Scenario:-

There is a Link web part and a Page viewer web part on the web part page. The requirement is that, whenever a user clicks on a particular link inside Link Web Part it should automatically render the corresponding page inside the page viewer web part.

Challenges:-

By default the page viewer web part does not support connections.

Solution:-

The solution is to create a page viewer web part that accepts the url as the connectable parameter. There is an interesting post by Todd Baginski about creating a connectable Page Viewer Web Part

http://www.sharepointblogs.com/tbaginski/archive/2007/08/16/connected-page-viewer-web-part.aspx

Even though the code-sample mentioned in the above link is for SPS 2003, we need to do code changes if we are developing it for WSS 3.0 / MOSS 2007. Probably if we are developing the web part as “SharePoint web part” the code changes we’d be making is less, compared to developing it as “ASP.NET” web parts.

I’d try this developing it for WSS 3.0/ MOSS 2007 and share my experiences

 Subscribe to my post