Neudesic Blogs

Think Smart. Get Results.
Welcome to Neudesic Blogs Sign in | Join | Help
in Search

Jason Noble

Programmatically Setting Multi-User Columns in SharePoint

Scenario

You want to be able to programmatically set a Mult-User column of an SPListItem. The trick is to build a string that represents the users in the following format

SPUser user1 = {some SPUser};

SPUser user2 = {another SPUser};

string multiUser = user1.ID + ";#" + user1.Name + ";#" + user2.ID + ";#" + user2.Name

 

So your string should look like this

string multiuser = "1;#Jason Noble;#2;#Administrator";

Then you can use the standard syntax for setting the SPListItem's column…For example

myListItem["AMultiUserColumn"] = multiUser;

Hope this helps…

 

 

Published Saturday, September 06, 2008 5:41 PM by Jason Noble

Comments

No Comments
Anonymous comments are disabled

This Blog

Post Calendar

<September 2008>
SuMoTuWeThFrSa
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

Syndication

Powered by Community Server, by Telligent Systems