Hot answers tagged

2

Edit the page containing the Discussion Board List. Select the web part and Click on Edit webpart. Select Toolbar Type to "No Toolbar" and save the webpart.


2

You also need to set properties.Cancel = true; Your final code will look like public override void ItemAdding(SPItemEventProperties properties) { try { //my code SPListItem parentItem = oList.GetItemById(discussionId); SPListItem reply =SPUtility.CreateNewDiscussionReply(parentItem); reply["Body"] = ...


1

Shailen Sukul has a great example posted on the MSDN forums. I suggest you start there first. https://social.msdn.microsoft.com/Forums/en-US/54d780ea-df2f-408d-9056-cf6f0c27f04e/add-xsltlistviewwebpart-via-code?forum=sharepointdevelopmentprevious


1

So you can achieve this using changing the view of your Discussion board. Path : Your discussion board -> List Setting -> Views -> Threaded(Flat in online) -> check this option --Make this the default view -> Save.


1

I figured it out! The Body text had been changed from Rich HTML text field to a Plain text field. Changing this back to Rich HTML fixed the problem. I'm not entirely sure why, but I suspect it is because the Reply field and Body text are linked in some way. I cannot see if it is possible to make the Reply field plain text as well; I imagine this would ...


1

In code you can SPGroup spGroupItem = web.Groups["GroupName"]; SPRoleAssignment oRoleAssignment = web.RoleAssignments.GetAssignmentByPrincipal(spGroupItem); foreach (SPRoleDefinition inRole in oRoleAssignment.RoleDefinitionBindings) { //inRole.id //inRole.Name //1073741829 //limited access } Or you can find it using below function bool ...


1

A discussion board comes with two content types: Discussion and Message. Discussion is the high-level content type, Message is all the replies. If you add your "State" or "Status" field or whatever to the Discussion content type, it will only apply to the question, not the responses. Create a Site Column called State, and give it whatever values you ...


1

Using jquery would be fine, but just flip the approach. Instead of hiding the webpart if its empty , make the webpart hidden by default, and visible only when content is available. Here is the approach. Add a Content Editor / Script Editor webpart with CSS code that hides(remember just mark display none / visible false, dont remove) the Discussion List ...


1

Try get_fieldValues() on item.



Only top voted, non community-wiki answers of a minimum length are eligible