473,387 Members | 1,520 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,387 software developers and data experts.

Sorting custom paged gridview resets PageIndex

hi,

I have a gridview which is bound to ObjectDataSource which in turn
reads from a business objects methods for custom paged data. When
PageIndex is set to any value other than 0 and one of the column
headers is clicked for sorting, the pageindex gets reset to 0. I tried
to debug it . the PageIndex property of gridview stays the same in the
Sorting event of gridview, but I see it changes to 0 in the Selecting
event of the ObjectDatasource.

Just wondering if any one else came across such a behavior.
Any leads will be appreciated.
Thanks in advance.

Aug 22 '07 #1
2 3325
Hi Aamir,
from my point of view, this is expected behaviour. Sorting event is raised
when databinding takes place = state of component is reseted. You can store
page index somewhere before selecting event and set it again in GridView's
DataBound event handler.

Regards,
Ladislav

"Aamir Ghanchi" wrote:
hi,

I have a gridview which is bound to ObjectDataSource which in turn
reads from a business objects methods for custom paged data. When
PageIndex is set to any value other than 0 and one of the column
headers is clicked for sorting, the pageindex gets reset to 0. I tried
to debug it . the PageIndex property of gridview stays the same in the
Sorting event of gridview, but I see it changes to 0 in the Selecting
event of the ObjectDatasource.

Just wondering if any one else came across such a behavior.
Any leads will be appreciated.
Thanks in advance.

Aug 23 '07 #2
I am sory sorry, I have mistyped name of event. Selectiong event is raised
when databinding takes plase...

Best regards,
Ladislav

"Ladislav Mrnka" wrote:
Hi Aamir,
from my point of view, this is expected behaviour. Sorting event is raised
when databinding takes place = state of component is reseted. You can store
page index somewhere before selecting event and set it again in GridView's
DataBound event handler.

Regards,
Ladislav

"Aamir Ghanchi" wrote:
hi,

I have a gridview which is bound to ObjectDataSource which in turn
reads from a business objects methods for custom paged data. When
PageIndex is set to any value other than 0 and one of the column
headers is clicked for sorting, the pageindex gets reset to 0. I tried
to debug it . the PageIndex property of gridview stays the same in the
Sorting event of gridview, but I see it changes to 0 in the Selecting
event of the ObjectDatasource.

Just wondering if any one else came across such a behavior.
Any leads will be appreciated.
Thanks in advance.
Aug 23 '07 #3

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

Similar topics

2
by: asad | last post by:
Hello friends, i am designing a ASP.NET page where i want to use custom paging bcoz data is too heavy so pls tell me how can i use custom paging in ASP.NET Thanks
1
by: John A Grandy | last post by:
In regard to a GridView that must support searching, filtering, sorting, and paging ... There is a tradeoff in performing the sorting and paging in the database versus to creating a CLR sort...
1
by: castron | last post by:
Hello All, I have a grid view that allows sorting, paging, editing, etc. Under On Load event, if I check: if(!IsPostBack){ DisplayData(); }, the Edit portion works fine. However, the Sorting...
16
by: pupilstuff | last post by:
hi guys i just want to perform custom paging in which at the footer of the grid view ,there must be a pager 'pervious/next with numeric' this is what i did in aspx page <asp:GridView...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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...

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.