473,586 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Anyone know why PageIndexChange d event is not firing on a Datagrid that is inside a user control?

I checked to see if its wired correctly:

private void InitializeCompo nent()
{
this.DataGrid1. PageIndexChange d += new
System.Web.UI.W ebControls.Data GridPageChanged EventHandler(th is.DataGrid1_Pa geIndexChanged) ;
this.DataGrid1. EditCommand += new
System.Web.UI.W ebControls.Data GridCommandEven tHandler(this.D ataGrid1_EditCo mmand);
this.Load += new System.EventHan dler(this.Page_ Load);
}
private void DataGrid1_EditC ommand(object source,
System.Web.UI.W ebControls.Data GridCommandEven tArgs e)
{
DataGrid1.EditI temIndex = e.Item.ItemInde x;
GetData();
}

private void DataGrid1_PageI ndexChanged(obj ect source,
System.Web.UI.W ebControls.Data GridPageChanged EventArgs e)
{
DataGrid1.Curre ntPageIndex = e.NewPageIndex;
GetData();
}

and it looks fine... paging works fine also, just the edit command isn't
getting fired???

Any one have any suggestions? Thanks in advance...

Long Le
Le******@msn.co m
Nov 18 '05 #1
1 2031

"Long Le" <le******@msn.c om> wrote in message
news:ug******** ******@TK2MSFTN GP11.phx.gbl...
I checked to see if its wired correctly:

private void InitializeCompo nent()
{
this.DataGrid1. PageIndexChange d += new
System.Web.UI.W ebControls.Data GridPageChanged EventHandler(th is.DataGrid1_Pa geIndexChanged) ;
this.DataGrid1. EditCommand += new
System.Web.UI.W ebControls.Data GridCommandEven tHandler(this.D ataGrid1_EditCo mmand);
this.Load += new System.EventHan dler(this.Page_ Load);
}
private void DataGrid1_EditC ommand(object source,
System.Web.UI.W ebControls.Data GridCommandEven tArgs e)
{
DataGrid1.EditI temIndex = e.Item.ItemInde x;
GetData();
}

private void DataGrid1_PageI ndexChanged(obj ect source,
System.Web.UI.W ebControls.Data GridPageChanged EventArgs e)
{
DataGrid1.Curre ntPageIndex = e.NewPageIndex;
GetData();
}

and it looks fine... paging works fine also, just the edit command isn't
getting fired???

Any one have any suggestions? Thanks in advance...

Long Le
Le******@msn.co m

Nov 18 '05 #2

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

Similar topics

2
16989
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of the columns of the data grid contains a DropDownlist. I managed to create this datagrid control as follows.
3
6761
by: Rick Strahl [MVP] | last post by:
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"
3
1194
by: Rubble | last post by:
Ive been having some weird issues with the microsoft grid control and its paging feature. Overview: I have a webform that loads a custom user control. This user control has several datagrids on it, but I only bind one from the calling webform based on user selections. Behavior: Once the grid displays I can go from page 1 to page 2...
0
1070
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 without the rowfilter that user selected from 5 dropdownlists. I received the exception error on the code I wrote for calling the cached session in...
4
4791
by: vatech1993 | last post by:
I'm stumped on this problem. I've created a user control that dynamically creates 5 linkbuttons in the CreateChildControls method. Each of these child controls is linked to a commandeventhandler, has command name and argument attached and is assigned a unique id. If I use this control on a web form everything works fine, the event fires as...
2
1129
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 code in my datagrid ItemDataBound
2
3366
by: Deepesh | last post by:
Good day, I have a specific case of the DataGrid in my solution which is causing the ItemCommand Event Not Firing. So I'm creating a "Skinnable" set of controls. I seperate the actual ASCX file and .CS file. When I initialize my .CS file, in that code there is a method that goes: Page.LoadControl(FILENAME) Which associates a .ascx file...
4
4148
by: EvelynAnd Ethan | last post by:
Hi, ItemCommand event not firing from a dynamic user control ,WHERE A DATAGRID HAS BUTTON,when i click on the linkbutton first time the itemcommand event doesnt fire,second time event fires up any answers?? Regards,
10
27827
by: Tim Frawley | last post by:
I am attempting to detect a Shift+Tab in the KeyPress event for back navigation on a control that doesn't support this method. Does anyone have any ideas how to compare e.KeyChar to a ShiftTab? Tim
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8202
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8216
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3837
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1180
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.