Sorting custom paged gridview resets PageIndex

A

Aamir Ghanchi

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.
 
G

Guest

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
 
G

Guest

I am sory sorry, I have mistyped name of event. Selectiong event is raised
when databinding takes plase...

Best regards,
Ladislav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top