Hello All,
We have an UI where user selects a department. It goes into a List item. We have separate SharePoint user groups for each department.
I want to populate the users in the SharePoint group in one of the list Item. So now based on department selected I need to populate the List Item.
Please help me in doing this. I am able to get all the users in a group using:
DropDownList ddl = new DropDownList();
ArrayList al = new ArrayList();
SPWeb web = SPContext.Current.Web;
SPGroupCollection grpCln = web.Groups;
foreach (SPGroup grp in grpCln)
{
if (grp.Name == "Viewers")
{
foreach (SPUser user in grp.Users)
{
al.Add(user.Name);
}
}
}
ddl.DataSource = al;
ddl.DataBind();