Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matt Taylor 873 posts 2086 karma points
    Jan 31, 2011 @ 17:16
    Matt Taylor
    0

    Examine search, ICollection

    I've been watching the video on setting up a site search with Examine and it's got me up to speed very quickly.

    I wanted to implement some paging in my user control macro but the Repeater control doesn't come with it and requires a bit more coding http://www.4guysfromrolla.com/articles/081804-1.aspx.

    I don't want to use a GridView because that renders tables.

    I had got as far as using a ListView which can be used easily with the DataPager, http://www.4guysfromrolla.com/articles/021308-1.aspx but of course when I tried it I discovered that the ISearchResults interface does not implement ICollection the ListView cannot be bound to it if paging is in use.

    Does anyone have any advice because at the moment it looks like I'll have to go down the Repeater route?

  • Matt Taylor 873 posts 2086 karma points
    Feb 08, 2011 @ 13:21
    Matt Taylor
    1

    If it helps anyone else, I ended up using the IEnumerable methods Skip & Take to just select the results I wanted to display and implemented my own paging:

    searchResultsRepeater.DataSource = SearchResults.Skip(_currentPage * _pageSize).Take(_pageSize);
  • Matt Taylor 873 posts 2086 karma points
    Jan 18, 2013 @ 15:25
    Matt Taylor
    100

    Just convert the IEnumerable list to an Array:

    searchResultsListView.DataSource = SearchResults.ToArray();

     

Please Sign in or register to post replies

Write your reply to:

Draft