Modify forum threads

To modify a thread, you must perform the following:

  1. Get an instance of the manager.
    Get an instance of the ForumsManager object.
  2. Get the specified thread.
    Get an instance of the thread. For more information, read For developers: Query forum threads.
  3. Modify the instance of the thread.
    Update the values of the properties of the thread.
  4. Save the changes.
    Save the changes to the manager.

Here is a code example:

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

namespace SitefinityWebApp
{
    public class ModifyForumThreads_ModifyThread
    {
        public static void ModifyThread(Guid threadId, ForumThreadType threadType)
        {
            ForumsManager forumsManager = ForumsManager.GetManager();

            ForumThread thread = forumsManager.GetThread(threadId);
            thread.ThreadType = threadType;

            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?