NeedsDataSource with options...?

3 posts, 0 answers
  1. Steve
    Steve avatar
    1871 posts
    Member since:
    Dec 2008

    Posted 17 Apr 2010 Link to this post

    I'm populating my listview with some objects via linq (where\orderby) in the NeedsDataSourceEvent

    I then also have a textbox on the page for searching...when text is typed into the box, user clicks "search" which really just rebinds the listview and in needsdatasource I grab that textbox search value and bind on that.

    The issue I'm running into is when the user does a search filter and clicks a pager item, the entire thing re-binds with the full default datasource again...

    Is there some trick to this?
  2. Rosen
    Rosen avatar
    3247 posts

    Posted 19 Apr 2010 Link to this post

    Hi Steve,

    Unfortunately I'm unable to observe this unwanted behavior locally. I have attached a small test page, can you please take a look maybe I'm missing something obvious.

    All the best,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Jeff P
    Jeff P avatar
    37 posts
    Member since:
    Mar 2007

    Posted 29 Apr 2010 Link to this post

    Upopn paging, sorting, filtering, etc the needdatasource event will fire with a reason code of "2" = explicit rebind.  The only way around this is to use a datasource object control instead of this event and enable caching.  The datasource control will decide wether or not a new call is needed to the datasource.
Back to Top