Archive

Posts Tagged ‘Visual Web Part’

Populate a drop-down list with SharePoint list values

October 25, 2012 Leave a comment

This video will demonstrate how to populate a asp.net drop down list control with SharePoint list column values. I’ve created a visual web part in Visual Studio 2010 and used the sever object model to demonstrate this. However, you can populate a drop down list with the client object model if you prefer.

Get the code

Moving repeating table values to another list using a Visual Web Part in C#

October 12, 2012 Leave a comment

InfoPath 2010 repeating tables are useful and sometimes even essential to the project requirements. However, they carry with them some problems. For one thing when multiple values are entered into an InfoPath 2010 form all of the values become crammed into one SharePoint 2010 column. This will cause all kinds of problem down the road if you ever need to access that Info and/or filter it etc. So the following example shows how to move the repeating table values to a separate list where the values can be more efficiently managed.

  • I’ve created a Visual Studio 2010 visual web part that fires the code on page load
  • You must have a delimiter to separate the values. In this case I have used a ;
  • Do NOT add a ; to the last repeating table entry. If you do you will have and extra record in the new list.

How does it work? View the Video below:

The Type or namespace name “DateTimeControl” does not exist in the namespace “Microsoft.SharePoint.WebControls”

October 12, 2012 1 comment

If you create an empty SharePoint 2010 project in Visual Studio 2010 and then add a visual Web Part (Sandboxed) you will get an error when you try to debug.

The Type or namespace name “DateTimeControl” does not exist in the namespace “Microsoft.SharePoint.WebControls”


However you can add the DateTimeControl to a farm solution visual web part.