Click here to Skip to main content
Click here to Skip to main content

Google-like PageLister control which helps to organize paging representation of your data.

, 15 Feb 2004
Rate this:
Please Sign up or sign in to vote.
Google-like PageLister control which helps to organize paging representation of your data.

Sample Image - demo.gif

Introduction

Some time ago, while I was working on one of my projects, I needed a control for paging representation of some data. When I'm talking about "paging representation", I mean representation in portions, page by page. Probably, the best example of it you can find on virtually any search machine like google, altavista etc.

What I needed is a line of clickable links representing pages filled with some information with current page highlighted. When a link is clicked, an event must be fired to allow the application to change the page.

First, I tried to find such a control somewhere in the net but my brief search wasn't successful. The requirements for the control were pretty simple so I decided that I would spend less time writing it than looking for it.

As I said, the control is pretty simple and, I hope, well commented. You surely don't need to be a genius to write something like this yourself. Here I skip most of the realization details and describe the control's interface.

Control's interface

What this control has is only three properties and one event.

The properties are:

  • uint PagesCount {get; set;} - gets or sets the total number of pages the control must present.
  • uint CurrentPage {get; set;} - gets or sets 1-based number of the current page.
  • uint NumPagesShown {get; set;} - gets or sets the number of links that can be shown on each side of the current page's link. Normally, you see current link in the centre of the links line and equal number of links (NumPagesShown) on each side. Of course, when current page is close to the beginning or to the end of line it moves from the central position. So, the maximal total number of links shown is 2*NumPagesShown + 1 or PagesCount, whatever is less.

The event PageChanged is fired when the current page is changed. The only event handler's parameter, currentPage is the new current page's number which you can also receive using CurrentPage property.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Artem Kliatchkine
Web Developer
Belgium Belgium
No Biography provided

Comments and Discussions

 
Generalsimple & artistically PinmemberNorton19-Feb-04 15:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.141022.2 | Last Updated 16 Feb 2004
Article Copyright 2004 by Artem Kliatchkine
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid