Try Now
More in this section

News Paging

2 posts, 0 answered
  1. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    09 Oct 2009
    31 Aug 2010
    Link to this post
    Hello Team Telerik,
    I am using a custom News View Controls to display the content on my page by inheriting from NewsView class.
    Please help me in achieving the following:

    1. I have a pager control on the page and need to have the total count of records on the header of the paging control.
    Say, Page 1 of 4, Displaying records 11-20. This should be available on the header tempalte of the paging repeater control.

    2. I need to get the current page so that I can set a different class to my selected page and change from linkbutton to Literal control during runtime.

    3. Currently, the footer has a paging displayed. I need to have the paging both at the top and the bottom.

    Siddesh Kapadi
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    01 Sep 2010
    Link to this post
    Hi Siddesh Kapadi,

    Please find instructions on how to achieve this bellow.

    1) You need to map the external template for list mode for the News View (~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx).
    2) To add a second pager on top of the list is easy - just copy the same pager, give it another id (e.g. pager2) and on page load set pager2 = pager1. Also pager class has ItemCssClass and SelectedItemCssClass properties which can be set from the markup to provide custom classes for pages and the selected page.
    3) To substitute the link button with literal you need to create custom pager class which inherits from our pager, and on item data bound event of the repeater to check if it is the selected page to remove the link button and add literal. Note that literal control does not have attributes, it is rendered as plain text on the page - not as Html element. This means that you have to wrap the literal in a li element first.

    Attached are sample files which you can use to achieve the above mentioned functionality.

    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered