473,486 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pager restting itself in gridview

Bob Ross
119 New Member
In my application in several of the gridviews if I click links within in the grids 5 times or more (links are opening new windows) then it treats the next pager click as a fresh laod of the page and returns you to page 1. It is not hitting the pageIndexChanged event just the page_load.

The strange thing is my gridviews are working in very different ways and still doing it. Some are simply bound in the code behind to a collection with a function for handling paging. Some are using an objectDataSource which fetches a dataview from a function. Some of the links are using javascript to open a new window. Some are standard links with target of "new".


Any one heard of this before? Anyone any help?

I have tried buidling a simple test app add it does not do this. But these gridviews in my app seem to have nothing in common.
Oct 10 '07 #1
3 1197
Plater
7,872 Recognized Expert Expert
I had the same problem, but I know how to fix it!
The issue is that when you click on a pager_index, the whole page is being reloaded, so any of the gridviews that weren't involved in the paging, reset back to first page.

Here's what I did:
In my page_change event function, I added a pair to the session object called say "gridviewOrders" with the value of the page it is displaying.
I do the same with say "gridviewUsers" (just examples, important thing is a different name for each gridview you want to track)

Then in the page_load event function, at the end, I check to see if these objects exist in the session, and if they do, change the gridview pages to the page saved in the session object..
Oct 10 '07 #2
Bob Ross
119 New Member
Thanks for you help but unfortunately this is not the same problem.
There is only one grid on the pages with the problem (other pages with two grids acutally work fine).
When the problem occours the first event I can catch after I have clicked on the pager is the page_load so there is no way of saving the page index.
Oct 10 '07 #3
Plater
7,872 Recognized Expert Expert
Ah yes, after re-reading it I see it now. That's what I get for not looking closely.
Oct 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
7169
by: Sławomir Marcinkowski | last post by:
Hello, can someone show use example use smarty pager plugin? {pager rowcount=$LISTDATA.rowcount limit=$LISTDATA.limit txt_first=$L_MORE class_num="fl" class_numon="fl" class_text="fl"} I'm...
36
10006
by: Richard | last post by:
My employer currently pays me $1/hour when I carry a pager. I have to carry the pager every fourth week. The problem is that my employer insists that I be available when I'm carrying the pager. ...
1
2069
by: strout | last post by:
I know it's dumb ... sometimes frustrating I want the text and a dropdownlist align with both side of a table cell, i.e. text align left and dropdownlist align right. I cannot add more cells to...
0
1806
by: Ray | last post by:
I am trying to add a "Next >" and "<Prev" button to the pager of my datagrid. I have been able to add the hyperlinks to the pager. I am now trying to determine the correct postback script to...
0
1742
by: bdtmike | last post by:
I'm using the GridView control and have the Mode of the Pager set to "NumericFirstLast". However, when there are several pages to display, the pager shows only page numbers--and no First/Last...
1
3436
by: SMichal | last post by:
Hi, I need a liitle help with build of my custom pager for gridview...I made this kind of pager..I looks like this: << < 1 2 3 4 5 6 7 8 9 10 > Well...it's no bad but I wannt something like...
0
862
by: Mr. SweatyFinger | last post by:
i need Previous 123456 Next How can i do this using the custom pager setting? thanks
2
1323
by: Stuart Ferguson | last post by:
I am using a GridView control with auto paging in a web application I am currently developing and was looking to customise the pager. I need to make the overall page numbers larger and also change...
5
3002
by: imbirek8 | last post by:
Hello I am looking good Pager to asp.net GridView Control. I would like to have: next/previous page, X results on page and go to X page. Can you recommend me a good (and free) Pager to GridView...
0
7105
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,...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7341
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5439
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
266
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.