473,378 Members | 1,478 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,378 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 882
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...
4
by: masantha wee | last post by:
Hi all, I am using Firefox and embedding Javascript in html. I understand that we can use mouse events by coding them in the body of html (by creating a button or anything and by adding in the...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.