473,394 Members | 1,701 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,394 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.
Jul 21 '05 #1
0 1590

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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.