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

DataSource issue

2 Answers 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
El
Top achievements
Rank 1
El asked on 25 Jan 2009, 08:10 PM
Hello,

I am trying to display a product list to radgrid and it seems fine except one thing.
When i load the page i bind the whole list of the products. Then i have a field search and when you do search i want to bind only the products that match keywords .. means different data. And it works initially. But if i click another page e.g. page #2 it load the whole list again.

<on load event handler>
If Not Page.IsPostBack Then
RadGrid1.DataSource = WholeList
.....



<on button click even handler>
RadGrid1.DataSource = SearchResult

Means how do i manage the situation with remaining the new data even if i click another page (paging)?

Thanks

P.S. maybe i need to have a flag or something ?

2 Answers, 1 is accepted

Sort by
0
El
Top achievements
Rank 1
answered on 27 Jan 2009, 08:24 AM
* bump *
0
Princy
Top achievements
Rank 1
answered on 30 Jan 2009, 11:26 AM
Hello,

In your scenario, I suppose you are binding the grid with the filtered data on the click event of a button. While clicking on the pager button, events(PageLoad, RadGrid_PreRender etc) other than the button click will be firing. If you want the grid to perform paging with the filtered data, it is better to bind the grid with the filtered data in the RadGrid_PageIndexChanged event or PageLoad event itself, so that it will be firing each and every time a page is changed.

Thanks
Princy.
Tags
Grid
Asked by
El
Top achievements
Rank 1
Answers by
El
Top achievements
Rank 1
Princy
Top achievements
Rank 1
Share this question
or