468,283 Members | 1,841 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,283 developers. It's quick & easy.

Complex Challenge Custom Paging of a DataGrid

This is a real brain-teaser and i'd really appreciate it if someone can try
and understand what im trying to do and give me a few pointers or ideas to
help me work out my problem.
Im basically using the example of CUSTOM PAGING on a DataGrid on this page:
http://www.dotnetjunkies.com/Tutoria...B871F967F.dcik
and im trying to add extra functionality in the DataGrid Paging - Custom
Paging example. I'm able to get the navigation working which does the
following

First < > Last

But now I want to add extra funtionality which allows me to navigate doing
something like this

First << < |1|2|3|4|5| > >> Last
when the >> is clicked I want this to happen. when each button is clicked
I'd like the datagrid to go to the correct page.
First << < |6|7|8|9|10| > >> Last

Here is the part of the code which I think my code needs to be added to
achieve this. Can someone please help me. Please refer to the example on the
web page to understand what im trying to do.

protected void NavigationLink_Click ( Object sender, CommandEventArgs e )
{
switch ( e.CommandName )
{
case "First":
_currentPageNumber = 1;
break;

case "Last":
_currentPageNumber = Int32.Parse ( TotalPages.Text );
break;

case "Next":
_currentPageNumber = Int32.Parse ( CurrentPage.Text ) + 1;
break;

case "Prev":
_currentPageNumber = Int32.Parse ( CurrentPage.Text ) - 1;
break;
case "Next5":
/* Need code in here to allow the Page navigation to do something fairly
complex. I want my pages to go like this
|1|2|3|4|5| to |6|7|8|9|10| when I click the Command Next5.
You see this all the time in hotmail, this weeksite etc. Basically I'm using
custom paging navigation to navigate through my datagrid, but i've never done
anything like this before and im finding it tough. I used the example on
http://www.dotnetjunkies.com/Tutoria...B871F967F.dcik
but now I want to add extra functionality by adding numbers of pages. In
this Case statement I want to be able to add extra cases which allow me to go
to the correct pages. My Navigation bar looks like this:
First << < |1|2|3|4|5| > >> Last.
*/
//_currentPageNumber = Int32.Parse ( CurrentPage.Text ) + 5;
//break;
}
BindData();
}

The databind method along with the other code is on the website. Its an
excellent link, its just I need to go a step further.
Jul 21 '05 #1
0 1410

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Clint | last post: by
reply views Thread by Raed Sawalha | last post: by
2 posts views Thread by ager | last post: by
2 posts views Thread by asad | last post: by
2 posts views Thread by asad | last post: by
reply views Thread by settyv | last post: by
reply views Thread by NPC403 | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.