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

Best practice when filtering large data set in grid

1 Answer 222 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Frank Grimes
Top achievements
Rank 1
Frank Grimes asked on 04 Feb 2010, 03:13 PM
What is the best practice you would suggest when filtering a fairly large data set (~400K records) in the grid? This is my current scenario:

1. I have a grid, a couple of search fields, and a search button. Standard paging is enabled in the grid.
2. The grid has a NeedDataSource event handler that runs a query against my database and then populates the grid with the results from the query. This query selects all records from the appropriate database tables. The DataSource property of the grid is set to this query.
3. The Click event handler of the search button checks if any of the search fields has text in it. If so, the FilterExpression of the grid is built with the proper criteria. If no search fields have any text, then the FilterExpression will remain empty and all records are returned. At the end, the Click event handler calls Rebind() on the grid, which in turn will call the NeedDataSource event handler.
4. The Page Index Changed event handler updates the current page index and calls Rebind() on the grid.

The filtering and paging work but it's rather slow (~20 seconds). Is this the correct approach for this problem? I'm worried that I'm getting all database records every single time and my application will be used in a low-bandwidth scenario. Or would it be better to change my query in the NeedDataSource event handler directly so that the grid DataSource property is only set to what is actually specified in the search criteria rather than use the FilterExpression?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Feb 2010, 09:32 AM
Hi,


I would suggest you have  a look at the Client Side Binding feature offered by RadGrid and let me know if this helps.

Thanks,
Princy
Tags
Grid
Asked by
Frank Grimes
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or