Ultimate Collection - { fslBlog & faisalmb.com } Ultimate Collection - { fslBlog & faisalmb.com }   
Blog   |   Site   |   Posts (347)   |   Tags Xplorer   |   Feed Subscribe Free! Now surfing... Sign in    Partner Site - Real Home Contact Search   

Fri

26

Feb

2010

Fri-26-02-2010
   

Eid Milad Un Nabi (صلی اللہ علیہ و سلم)



Jashn-e-Eid Milad Un Nabi Mubarak

 (صلی اللہ علیہ وسلم)

Happy Birthday of Prophet Muhammad sallalLaho alaihi wassallam

25 Feb 2010 - Saudia / UAE

26 Feb 2010 - Pakistan

 

 


Thu

11

Feb

2010

Thu-11-02-2010
   

Sharepoint - SPWeb.Groups Vs SPWeb.SiteGroups



SPWeb has two sharepoint cross-site group collection, SPWeb.Groups and SPWeb.SiteGroups.

SPWeb.Groups returns collection of cross-site groups which has some permission on the site. So if you add group from a site without any permission on the site, then this group wont appear in SPWeb.Groups collection, but it will appear in SPWeb.SiteGroups collection.

You can not use SPWeb.Groups.Add method to add new cross-site group, you need to use SPWeb.SiteGroup.Add method for this purpose.

In addition to this SPWeb has a property AssociatedOwnerGroup, which will return the required SPGroup. You can iterate the SPGroup users to get the list of all owners of the site.

 foreach (SPUser user in web.AssociatedOwnerGroup.Users)
 {
      // .. list all the users                        
 }

 

Finding and adding group

SPGroup  group = GetSiteGroup(web, "groupName");
if (null == group)
{
 web.SiteGroups.Add("groupName", web.AssociatedOwnerGroup, null, "Test Group description");
}

 


private static SPGroup GetSiteGroup(SPWeb web, string name)
{
    foreach (SPGroup group in web.SiteGroups)
    {
 if (group.Name.ToLower() == name.ToLower())
 {
     return group;
 }
    }
 return null;
}

 

 





Intro

Faisal Bashir
Consultant / Software Architect
KalSoft Limited
Microsoft Certified Technology Specialist.
Currently in Dubai. [more]

Right Now

How could u reach the pearl by only looking at the sea? if u seek the pearl, be a diver: the diver needs several qualities, he must trust his rope and his life to the Friend's hand, he must stop breating and he must jump - Jalaluddin Rumi.

Recent Comments

Comment RSS

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

Read in the name of your Lord Who created. Created the man from a (blood) clot. Read! Your Lord is the Most Generous, Who taught writing by the pen. Taught man what he knew not. (Holy Quraan - Al Alaq - 96-1to5)
376925 hits. (Best viewed @ 1024x768 resolution min.) Comments here...
© 2001-2011 Muhammad Faisal | Disclaimer | Contact | Partner Site