473,508 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PageIndexChanged not firing in DataGrid

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
----------------------------------
Making waves on the Web

Nov 18 '05 #1
3 6744
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

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:ON**************@TK2MSFTNGP12.phx.gbl...
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
----------------------------------
Making waves on the Web

Nov 18 '05 #2
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!

"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:ON**************@TK2MSFTNGP12.phx.gbl...
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
----------------------------------
Making waves on the Web

Nov 18 '05 #3
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
----------------------------------
Making waves on the Web
"vMike" <Mi************@gewarren.com.nospam> wrote in message
news:bp**********@ngspool-d02.news.aol.com...
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!

"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:ON**************@TK2MSFTNGP12.phx.gbl...
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
----------------------------------
Making waves on the Web


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8483
by: Ken Tucker | last post by:
I've read about this issue in many articles across the net... But haven't found a solution. I see all kinds of custom code to perform sorting with datagrids, but my example is so simple, I must...
1
7536
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
0
1170
by: MikeG | last post by:
Hi, I have a web page with a datagrid wich shows a view on miltidimensional data from analysis server. I want to restrict the data access by not repopulating my datasource when changing page. I...
1
2022
by: Long Le | last post by:
I checked to see if its wired correctly: private void InitializeComponent() { this.DataGrid1.PageIndexChanged += new...
0
1062
by: JenHu | last post by:
Hi experts, I am having trouble calling the cached dataview session and dataview.rowfilter session in the pageIndexChanged event. Currently, if user goes to page 2, the datagrid displays data...
2
1416
by: Gopalan | last post by:
Hi I have got a Datagrid populated with a Dataset. The first time the datagrid shows the first page data. When I clicked the Next link to display the next page data it displays the same...
2
1124
by: David | last post by:
Hi all, I am dynamically creating a LinkButton in my datagrid, however, the event that I am creating for it is not firing. I am obviously missing something? What am I missing? Here is the...
1
2386
by: Andy | last post by:
Hello, I have a datagrid within another datagrid. The innder datagrid contains a dropdownlist which fires an event as index change (OnSelectedIndexChanged). I can get the ItemIndex of the...
0
1016
by: ABN | last post by:
Hi, I want to trap PageIndexChanged event of datagrid at clientside, and want to take some actions before page gets postback. Actual process of data bind will take place in code-behind only....
0
7231
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,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7504
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
5643
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,...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
435
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.