arame3333
arame3333

Reputation: 10203

MVCContrib grid - I need a better pagination control

Pagination with MVCContrib is easy, just follow the steps here;

http://mvccontrib.codeplex.com/wikipage?title=Grid&ProjectName=mvccontrib

However the control render as

"Showing 1 - 15 of 32 first | prev | next | last"

This does not look very good. I would prefer a cleaner look with each page displayed as a link; "Pages: 1 2 3". I have not found any documentation as to how to do this with MVCContrib and .AsPagination. So how do I do this?

Upvotes: 0

Views: 218

Answers (1)

user425445
user425445

Reputation:

This is a link to the actual pager code on source forge.

The following code shows how the pager is built.
(just the top part - you can see where the first "|" is generated)

protected virtual void RenderRightSideOfPager(StringBuilder builder)
{
    builder.Append("<span class='paginationRight'>");
    //If we're on page 1 then there's no need to render a link to the first page. 
    if(_pagination.PageNumber == 1) {
        builder.Append(_paginationFirst);
    } else {
        builder.Append(CreatePageLink(1, _paginationFirst));
    }

    builder.Append(" | ");

I guess that you can replace the file as long as you follow the license rules:

 4. Redistribution.

You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:

  1. You must give any other recipients of the Work or Derivative Works a copy of this License; and

  2. You must cause any modified files to carry prominent notices stating that You changed the files; and

  3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; ...

You can see the full license here

Hope this helps , Enjoy life , Julian

Upvotes: 1

Related Questions