API Questions on Kentico API.
Version 6.x > API > Get to know if all forums in forum group are locked View modes: 
User avatar
Member
Member
vasiliy.ivanov1975-gmail - 4/24/2013 6:25:23 AM
   
Get to know if all forums in forum group are locked
Hello,

Need your help again. On my forums, I have some forum groups, where all forums are locked. I need to display the names for such groups with different style, on the main forums page (forums.aspx).

As I understand, the properties of forums in the group can be obtained from ForumContext.CurrentGroup.Children. My idea is to enumerate forums in the group and check one by one if they are locked. But I only achieved to get the count of forums in current group.

How can I get the properties of the children forums of the current group, or may be there is more simple way?

User avatar
Kentico Support
Kentico Support
kentico_filipl - 4/25/2013 1:45:11 AM
   
RE:Get to know if all forums in forum group are locked
Hello,

You can use GetAllForums(String where, String orderBy) method of ForumInfoProvider class.

If I understand you correctly, to get children forums of a particular forum group it should be used with parameters like this:
// Get all forums of a forum group
DataSet ds = ForumInfoProvider.GetAllForums("ForumGroupID = " + forumGroupID, null);

// Write forum names to textbox
if (!DataHelper.DataSourceIsEmpty(ds))
{
foreach (DataRow dr in ds.Tables[0].Rows)
{
TextBoxForum.Text += Convert.ToString(dr["ForumDisplayName"]) + ", ";
}
}

You can view all properties of a forum in Forums_Forum database table to achieve your required functionality.

Best regards,
Filip Ligac