Monday, April 30, 2012 1:43 PM
I want to get the list of all the users who has access to sharepoint in grid view and when i click the user from that list, I need to get the groups of that particulat user using Visual studio 2010.
Thanks & Regards
Monday, April 30, 2012 2:20 PM
SPWeb.Users and SPWeb.SiteUsers is what you're looking for I think.
Monday, April 30, 2012 4:47 PMI'm not sure if the syntax has changed much from that 2006 blog post but here is an additional example of SPWeb.Users on MSDN - http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.users.aspx
My Blog - www.JonesingForSharePoint.com
Monday, April 30, 2012 5:57 PM
you can just query the user info hidden list to find all the ensured users
the url of the hidden list is http://<site collection url> /_catalogs/users/simple.aspx
Dim userList as SPList = SPContext.Current.Web.SiteUserInfoList
SPQuery query = new SPQuery;
<FieldRef Name='Title' />
var users = userList.GetItems(query ).GetDataTable() ;
// now bind the data table to the grid view