This is a migrated thread and some comments may be shown as answers.

NeedsDataSource with options...?

2 Answers 61 Views
ListView
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 18 Apr 2010, 03:50 AM
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 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 19 Apr 2010, 02:26 PM
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,
Rosen
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.
0
Craig
Top achievements
Rank 2
answered on 29 Apr 2010, 04:07 PM
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.
Tags
ListView
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Rosen
Telerik team
Craig
Top achievements
Rank 2
Share this question
or