Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Messageboard Pagination View modes: 
User avatar
Member
Member
John - 10/15/2009 5:17:57 AM
   
Messageboard Pagination
Hi,

How can I achive Messageboard Pagination?

Thanks,

John

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 10/15/2009 7:34:01 AM
   
RE:Messageboard Pagination
Hi John,

This is not supported by default, but you can add UniPager control to ~\CMSModules\MessageBoards\Controls\MessageBoard.ascx file and link it to <cms:QueryRepeater ID="rptBoardMessages" /> control, in this way you should be able to use paging.

Best Regards,
Miroslav Remias.

User avatar
Member
Member
John - 10/16/2009 7:42:12 AM
   
RE:Messageboard Pagination
Hi Miroslav,

Before I follow your approach another question. Since I can use Messageboard repeater (basicly a plain repeater or a Messageboard viewer is there any way to add an input messageboard form to have the full functionality?

Thanks,

John

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 10/16/2009 8:41:16 AM
   
RE:Messageboard Pagination
Hi,

Yes, sure. You can for example modify MessageBoardViewer web part and add input control form (BoardMsgEdit) into ~\CMSWebParts\MessageBoards\MessageBoardViewer.ascx file.

Please add following code in the MessageBoardViewer web part file .ascx and .cs:

<%@ Register Src="~/CMSModules/MessageBoards/Controls/Messages/MessageEdit.ascx" TagName="BoardMsgEdit"
TagPrefix="cms" %>
<cms:BoardMsgEdit ID="msgEdit" runat="server" AdvancedMode="false" EnableViewState="true" Visible="true" />

protected void Page_PreRender(object sender, EventArgs e){
repMessages.DataSource = boardDataSource.DataSource;
repMessages.DataBind();
}


Best Regards,
Miroslav Remias.

User avatar
Member
Member
John - 10/16/2009 10:08:04 AM
   
RE:Messageboard Pagination

Hi,

Thanks for the suggestion, but there is still another minor problem: Data are refreshed next time I reload the page (Databinding happens in PreRender). I have to databind after the click event fires, but I have no event for click or something that I can think of!
Any ideas?

Thanks,

John

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 10/20/2009 7:17:34 AM
   
RE:Messageboard Pagination
Hi,

I’m sorry, but I do not understand now. I have tried my solution also with the code in Page_PreRender and it is working just fine. If you post new message to message board, page refreshes and the new entry in message board is displayed on the page, also the paging works just fine. Have you tried the posted code?

Best Regards,
Miroslav Remias.