Gridview OnPageIndexChanging not firing in beta 2

O

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
 
T

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.
 
O

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,296
Latest member
HeikeHolli

Latest Threads

Top