Click here to Skip to main content
14,971,029 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, When i m bind a datatable to gridview it will take more than 5 mins for 10000 records but the select query executed in 2 seconds and retrieve records in 2 seconds.what should i do for reduce the time
Shahan Ayyub 27-Dec-14 20:28pm
It is a good advice to use `VirtualMode` property for such cases, but how do you do binding ? For loop ? Have you tried setting `DataSource` property ? `grd.DataSource = dt`

1 solution

Easy. Don't try to bind 10,000 records to the damn grid!

Honestly, who in their right mind would want to look at 10,000 records all at once?

Use Virtual mode[^] in the grid properties and implement paging where you only bind the data to the grid that the user can actually see.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900