Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 5th, 2008, 02:48 PM
Friend of Wrox
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default Does GridView trigger PageIndexChanged event?


When I click on the page numbers at the buttom of the gridview, does it trigger the PageIndexChanged event on its own?

What I found to thsi point is that, I have to capture the RowCommand event, and set PageIndex myself, in order to trigger the PageIndexChanged event. It makes me feel that I missed something. This doesn't make any sense.
switch (e.CommandName) {
                case "Page":
                    GridView1.PageIndex = Int32.Parse((string)(e.CommandArgument)) - 1;
Old December 5th, 2008, 03:14 PM
Lee Dumond's Avatar
Wrox Author
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts

Yes, the PageIndexChanged event does fire whenever you click a page number. If you create a PageIndexChanged event handler, you should be able to confirm that the event is firing, as well as determine the current page index in the handler.


Visit my blog at http://leedumond.com
Old December 5th, 2008, 07:39 PM
Friend of Wrox
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts

Found out what's wrong, I didn't turn on EnableSortingAndPagingCallbacks.

Similar Threads
Thread Thread Starter Forum Replies Last Post
onmouseover trigger event JParent Javascript How-To 1 February 13th, 2006 10:26 AM
An activity by user B trigger an event for A bigmish Classic ASP Basics 1 July 3rd, 2004 04:28 PM
Trigger event on button click speedyH ASP.NET 1.x and 2.0 Application Design 3 June 27th, 2004 10:10 AM
Force an event to trigger YiannisF ASP.NET 1.0 and 1.1 Basics 2 June 2nd, 2004 08:52 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.