473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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.
Nov 16 '05 #1
0 1175

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alex | last post by:
I created a page to show RealEstate Data with images retrived from the MSSQL 2000. I am using a DataGrid control: <asp:datagrid AllowPaging="True" OnPageIndexChanged="Pageindexchanged" > ...
0
by: Stephen | last post by:
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...
3
by: Clint | last post by:
Hi, I am trying to implement the custom paging in the datalist in this format: << Prev 1,2,3,4,5 Next >>. Does anyone knows how to do this. Thanks in advance. Clint
0
by: Raed Sawalha | last post by:
I have aspx page with user control , in the user control i have DataGrid with custom paging the grid is displaying contents of datatable as following schema <xs:element name="id"...
2
by: ager | last post by:
Greetings, I have a problem that I am trying to work through. Any help would be appreciated. I have an asp.net application that uses framesets. It has a banner frame, contents frame, and a...
2
by: asad | last post by:
Hello friends, i am designing a ASP.NET page where i want to use custom paging bcoz data is too heavy so pls tell me how can i use custom paging in ASP.NET Thanks
1
by: thechaosengine | last post by:
Hi all, Can somebody tell me if the built in paging support for the datagrid works when using a custom collection and a custom business object as the data. I was well pleased when I found that...
2
by: asad | last post by:
hello friends, how ru all I want to create a custom paging logic in ASP.NET with a next link for example if i have 100 pages record so i want to show 6 pages link on page one and next link ...
0
by: richard | last post by:
OK, Im finished pulling my hair out and now I need help. I have created a VB class file for my custom paging, in it I create a table with 2 rows, in the rows I have linkbuttons for first page,...
0
by: settyv | last post by:
Hi, I am using built-in pagination in datagrid with asp.net 1.1 .Now i need to display 1-50,50-100,etc at the top and bottom on the datagrid control to display records.Please let me know how...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.