Sorting custom paged gridview resets PageIndex

  • Thread starter Thread starter Aamir Ghanchi
  • Start date Start date
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.
 
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
 
I am sory sorry, I have mistyped name of event. Selectiong event is raised
when databinding takes plase...

Best regards,
Ladislav
 
Back
Top