Hi there,
I guess it depends on the data source you bind it to. Some data sources, like the SqlDataSource have built-in caching capabilities. If you manually bind, you can use the Cache programmatically to store your own data.
However, it's worth considering if you really want to cache the data. Especially with sorting and paging scenarios for a GridView, caching may be counter-productive. Imagine you have a data set of 100,000 records and a GridView that displays 10 at a time. Do you really want to cache those 100,000 records on the first hit and select the 10 you need to display when a paging or sorting event occurs?
In most cases, doing paging and sorting at the database level (which is what LINQ to SQL does by default when you do it right (assuming you are referring to L2S with LINQ)) will give you much better performance as you're only selecting and transferring 10 instead of 100,000 records.
Hope this helps,
Imar
|