Home All Groups Group Topic Archive Search About

Gridview OnPageIndexChanging not firing in beta 2

Author
21 Apr 2005 2:08 PM
Ohio Mike
I recently installed the Visual Studio Beta 2 environment and now my
OnPageIndexChanging methods don't get called when a change page button is
clicked on the GridView control.  It worked fine in Beta 1, but now it
doesn't fire.   The change page buttons cause a postback, all of the controls
are loaded but niether the OnPageIndexChanging or OnPagedIndexChaged events
fire.  If anyone has any suggestions I would greatly appretiate hearing them.

Thanks

Author
23 Apr 2005 5:12 PM
Teemu Keiski
Seems to work fine in my tests (though I have dummy databinding and
autogenerating of columns).  Are you sure you have event handlers wired
correctly?  Post a sample code demonstrating the issue.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU


Show quoteHide quote
"Ohio Mike" <Ohio M***@discussions.microsoft.com> wrote in message
news:BAAE7973-0B50-420D-83F9-290ED9A37EFD@microsoft.com...
>I recently installed the Visual Studio Beta 2 environment and now my
> OnPageIndexChanging methods don't get called when a change page button is
> clicked on the GridView control.  It worked fine in Beta 1, but now it
> doesn't fire.   The change page buttons cause a postback, all of the
> controls
> are loaded but niether the OnPageIndexChanging or OnPagedIndexChaged
> events
> fire.  If anyone has any suggestions I would greatly appretiate hearing
> them.
>
> Thanks
Author
25 Apr 2005 11:56 AM
Ohio Mike
It turns out I had a couple of problems.  One was a url rewriter we were
using that needed to be fixed and the second was ViewState must now be
enabled.

I have noticed that the control acts differently depending on how you bind
the data to the control.  I'm using a dataset that contains 5 tables, so I
set the datasource, datamember and call the databind method in my binddata
method on the code behind page.  In beta 1 if you set the datasourceid
instead of the datasource, you didn't even need to create a method to handle
the onpageindexchanging event.  I haven't had time to play around with all of
the different scenarios, but the same exact code from beta 1 no longer worked
in beta 2.  After the url rewriter was fixed, when I changed the
enableviewstate property to true it worked fine.  When I changed
enableviewstate back to false, the event no longer fired.

Thanks,

Mike

Show quoteHide quote
"Teemu Keiski" wrote:

> Seems to work fine in my tests (though I have dummy databinding and
> autogenerating of columns).  Are you sure you have event handlers wired
> correctly?  Post a sample code demonstrating the issue.
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
>
>
> "Ohio Mike" <Ohio M***@discussions.microsoft.com> wrote in message
> news:BAAE7973-0B50-420D-83F9-290ED9A37EFD@microsoft.com...
> >I recently installed the Visual Studio Beta 2 environment and now my
> > OnPageIndexChanging methods don't get called when a change page button is
> > clicked on the GridView control.  It worked fine in Beta 1, but now it
> > doesn't fire.   The change page buttons cause a postback, all of the
> > controls
> > are loaded but niether the OnPageIndexChanging or OnPagedIndexChaged
> > events
> > fire.  If anyone has any suggestions I would greatly appretiate hearing
> > them.
> >
> > Thanks
>
>
>