Search code examples
c#asp.netlistviewpaginationlistviewitem

listview item indexing


I am using a listview with 6 items per page. When I choose an item from the 6 items it should take me to a page with 3 items per page BUT the selected item (on previous page) as FIRST item in the list on the new page. Basically how do I set which items shows first in the listview? Is that a property?


Solution

  • There is no property for setting the first item. If you are using a datasource, the items will be displayed in the order they occur in the datasource, which is generally the order that the database returns them.

    If you need a different ordering, you can code a loop through your datasource and assign the items to the ListView manually.