Some various like TheListView,LastSortField in the above event could not work well, and I could not find these keywords elsewhere.
Also, I want to ask that where do you call the BindListview event. Maybe this has affected the issue.
Best Regards,
Jenifer
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
I suggest that you coud mark your solution as answer if it solved your problem.
And this will be helpful for someone meets with the same problem.
Best Regards,
Jenifer
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
1 Points
22 Posts
Sorting a ListView with a Data Pager
Jan 15, 2019 07:20 PM|Whalensdad|LINK
I have a listview that I bind using custom code in the code behind:
The ListView has a DataPager
I created a custom sort routine that successfully sorts the list view.
The above snippet calls a routine that builds a SQL Statement which is applied to the fist code snippet above:
This ALL works ok. The issue is that if I change the page using the datapager, the sort is not maintained (i.e. page 2 and up are not sorted)
Here is the code for the listview:
Here is how I Bind the ListView
Contributor
2150 Points
705 Posts
Re: Sorting a ListView with a Data Pager
Jan 16, 2019 02:34 PM|Jenifer Jiang|LINK
Hi Whalensdad,
According to your description and code, I'm sorry that I could not reproduce your issue successfully.
Some various like TheListView,LastSortField in the above event could not work well, and I could not find these keywords elsewhere.
Also, I want to ask that where do you call the BindListview event. Maybe this has affected the issue.
Best Regards,
Jenifer
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
1 Points
22 Posts
Re: Sorting a ListView with a Data Pager
Jan 16, 2019 02:37 PM|Whalensdad|LINK
Jenifer - I actually figured it out about 20 min ago.
I forgot that I captured the datapager page change and was not passing in the "orderby" variable. Once I fixed that it works correctly.
Contributor
2150 Points
705 Posts
Re: Sorting a ListView with a Data Pager
Jan 17, 2019 01:48 AM|Jenifer Jiang|LINK
Hi Whalensdad,
I suggest that you coud mark your solution as answer if it solved your problem.
And this will be helpful for someone meets with the same problem.
Best Regards,
Jenifer
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.