Remove forums from forum groups

To remove a forum from a group, you must perform the following:

  1. Get an instance of the manager.
    Get instance of the ForumsManager object.
  2. Modify the forum.
    Change the value of the Group property of the forum to null or to the instance of another group. For more information, see For developers: Modify forums.

Here is a code example:

C#
using System;
using Telerik.Sitefinity.Forums;
using Telerik.Sitefinity.Forums.Model;

namespace SitefinityWebApp
{
    public class RemoveForumsFromGroup_RemovingForumFromGroup
    {
        public static void RemovingForumFromGroup(Guid forumId)
        {
            ForumsManager forumsManager = ForumsManager.GetManager();

            Forum forum = forumsManager.GetForum(forumId);

            //Set to null or to an instance of another group.
            forum.Group = null;

            forumsManager.SaveChanges();
        }
    }
}
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
New to Sitefinity?