Hi guys,
I have a webdatagrid with following data settings:
- EnableDataViewState="true"
- EnableViewState="true"
- EnableAjax="false"
- Implement CustomDataBinding
- current page has a Master page
My paging function works well but i'm facing problem with sorting at event SortingEventArgs.
for instance: i'm staying in Page 2 and i click on a column to sort. Normally, after running PageLoad, the SortingEvent should be fired but after running the PageLoad of current page, it runs the PageLoad of Master page and the SortingEventArgs is fired finally. When debugging at SortingEventArgs event i saw the WebDataGrid PageIndex is reset to 0 (it means i lost PageIndex, it should be 2).
How can i correct it?
Thanks,
Nam Dang
Hello Nam,Thank you for posting in our community. I have created a sample based on your scenario. I have tested the sample with FF 19 and Chrome latest and in the server event I can see the proper page to be pointed. Please take a look at the attached sample and modify it or attach a new one. Also please point if you are using different browser or build of our controls.
Hi Nikifor,
Maybe my question is not clear, so you're misunderstanding my issue.
I mean when i'm staying at page 2 and click on a column to sort the pageindex is reset to 0. And i'd like to keep the PageIndex when sorting.
thanks,
Hello Nam,Yes indeed in this case the selected page is not kept. What I would suggest is to use a hidden field in which on sorting to keep the pageindex and to set it on the server after the sorting is finished. I have modified the sample for your reference and I am attaching it in this forum post.
Thanks for your help, just let you know my issue is resolved.