473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

PageIndexChaned event not working

Hi,

I know this question has been asked many times, however I haven't
found any satisfying answer.
I have a datagrid that is bound to a dataset. I have established
paging on the grid (AllowPaging = true), but the PageIndexChanged
event only fires when AutoGenerateColumns is set to true. If I change
this property to false, the event does not fire.
So the paging only works ok when this property is set to true,
otherwise it does not work at all.
Any help?

Janez
Nov 18 '05 #1
5 802
Hello Janez,

As I understand, the question is: How to use PageIndexChanged event when
autogeneratecolumns is false in asp.net datagrid programming.

In MSDN, we have one sample on it.
"Creating a Pageable, Sortable DataGrid"
http://msdn.microsoft.com/library/en...geablesortable.
asp?frame=true#aspnet-pageablesortable_topic4
Please refer to "Creating a Sortable, Pageable DataGrid" part in this
article.

Please move your databind code to Page_Load to see if it has any effect.

Does that answer your question?

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 18 '05 #2
Hi,

thank you for your response.
You were right, after I moved my databind code from button_click to
Page_Load the event started to fire as should.
Well, things are a bit complicated now, because I have a lot of panels
on one page, a lot of buttons, so I need to check during the Page_Load
event which control triggered the postback (to know if datagrid must
be bound or not).
However, I think I will manage now (I hope so).

Thanks again
Janez
Nov 18 '05 #3
Hi Janez,

Glad to know my suggestion works for you. If you have any more concerns on
it, please feel free to post in the group.

Thanks for participating the community.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 18 '05 #4
I am having this exact same problem. I'm generating the columns in my datagrid dynamically though. Is that what you are doing? In every other scenario paging works fine. I'm a little new to ASP.NET. If I need to move my databind code to Page_Load, how do I determine which control triggered the post back?
Nov 18 '05 #5
Hi,

A simple way is to a hidden field to indicate it. Thanks.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 18 '05 #6

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

Similar topics

4
by: TheKeith | last post by:
Can someone tell me why this isn't working? <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script...
3
by: delerious | last post by:
I have a DIV that contains some links. I have an onmouseout event handler on the DIV, and I want it triggered only when the mouse leaves the DIV. Since there are Anchors in the DIV, onmouseout...
4
by: Pai | last post by:
hello there, I am trying to rersize the window it works find in IE but doea not work with mozilla window.attachEvent(onload,MWSOnLoad); window.onload = function (MWSOnLoad) { alert('hello');...
2
by: JeeWee | last post by:
Hi all, I'm looking for a way to "bind" multiple eventhandler function to the same event. In other languages this can often be done by using the += operator, unfortunately this doesn't seem to...
3
by: Lachlan Hunt | last post by:
Hi, I've been looking up lots of documentation and trying to work out a cross-platform method of capturing a keyboard event and working out which key was pressed. From what I can find, there...
5
by: Janez | last post by:
Hi, I know this question has been asked many times, however I haven't found any satisfying answer. I have a datagrid that is bound to a dataset. I have established paging on the grid...
3
by: Tony Dong | last post by:
Hi there I have three comboBoxs I need the first comboBox selected and fill the second comboBox, after second comboBox selected, it will fill the last comboBox, When I use selectedIndex change...
0
by: sillz | last post by:
On Apr 8, 2:00 pm, sillz <beth.sto...@gmail.comwrote: I never could get this to work. The oracle account tested fine. I ended up creating a new account in Windows with the right permissions...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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
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...

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.