PageIndexChanged not firing in DataGrid

  • Thread starter Thread starter Rick Strahl [MVP]
  • Start date Start date
R

Rick Strahl [MVP]

Hi all,

I'm loosing my mind <g>...

I have a datagrid and I can't for hte live of me not get the
PageIndexChanged event to fire in my codebehind form.

<asp:datagrid id="dgErrorLog" runat="server"
onpageindexchanged="dgErrorLog_OnPageIndexChanged"
enableviewstate="False" allowpaging="True" pagesize="20"
autogeneratecolumns="False" width="100%" >


Nothing that I haven't done a million times before, but on this page the
event in the codebehind is not firing:

protected void dgErrorLog_OnPageIndexChanged(object sender,
DataGridPageChangedEventArgs e)

{

this.dgErrorLog.CurrentPageIndex = e.NewPageIndex;

this.ShowLog();

}

All other events in the page are firing just fine and the EventTarget is
posting to the page just fine. But the event code just doesn't fire.

I've tried using descriptive referenceing (as above on the page) as well as
explicit event hookup through VS (so it shows up in InitializeComponent()).
Neither fires the event...


Anybody have any idea why this would happen? I've done this a million times,
but I can't see why in this case event handling is crapping out.

Any help appreciated...

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
 
You need to delete the datagrid, save the project. Close studio. Re-open the
project and add the datagrid back and rehook the handlers. That works about
75% of the time. I hope you don't fall into the 25%

regards
 
I had a similiar problem with Page_Unload. Wouldn't fire no matter what. I
took the words Page_Unload out, retyped them in and worked like a charm. Who
knows why? By the way Rick, also wanted to let you know that your article on
WebRequest/Response was outstanding. I have referred to it many times.
Thanks!
 
Thanks Mike,

Take them out of the source or the ASPX page? I have to play with that, but
I'm starting to think that hte issue is that I Cut and Paste the grid into
this page rather than adding it. But what's weird is that I've checked the
generated code and it looks fine to me...

Thanks on the article. Aprreciate the feedback!

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
 
Back
Top