Getting group data

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The following sample code shows how you can get a group as a GroupInfo object:

 

[C#]

 

using CMS.Community;

 

...

       // Get group object by GroupID

      GroupInfo gi = GroupInfoProvider.GetGroupInfo(1);

 

      // Get group object by GroupCodeName and SiteName

      GroupInfo gi2 = GroupInfoProvider.GetGroupInfo("customGroupName", "CommunitySite");

 

The following sample code shows how you can get a DataSet containing all groups in the system with a GroupID greater than 5, ordered by their Display name:

 

[C#]

 

using System.Data;

using CMS.Community;

 

...

 

        // Get DataSet of group objects

      DataSet ds = GroupInfoProvider.GetGroups("GroupID > 5", "GroupDisplayName");

 

Page url: http://devnet.kentico.com/docs/devguide/index.html?getting_group_data.htm