Tuesday 22 September 2015

How to get items from a DiscussionBoard List ?

public static void GetItemsFromList(SPList list)
        {
            SPListItemCollection items = null;
            // If the list template is Discussion board we need to get the folders instead of items
            if (list.BaseTemplate == SPListTemplateType.DiscussionBoard)
            {
                   items = list.Folders;
            }
            else
           {
                   items = list.Items;
           }
       }

No comments:

Post a Comment