I use LinqDataSource:
I want to implement caching in grids because grids usually show only the first page and no need to make query each time.
I can easily implement caching in linqDS_Selecting method.
The problem is that i dont think about pagination in linqDS_Selecting method, grid implements it instead of me.
so i can put all data in cache (i need to save in cache only the firsts pages which can be really navigated)
I tried to figure out how to hook the event when the grid passes data about its filtering and paging to linq, but i couldnt.
Does anybody know the ways how to do it?
<asp:LinqDataSource ID="linqDS" OnSelecting="linqDS_Selecting" runat="server" /><telerik:RadGrid ID="gridProducts" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" AllowMultiRowSelection="false" CssClass="roundBorders fixedRBPadding" PageSize="10" GridLines="None" DataSourceID="linqDS" EnableAJAX="True" EnableAJAXLoadingTemplate="True">protected void linqDS_Selecting(object sender, LinqDataSourceSelectEventArgs e) { ...creating context... e.Result = from productRecord in db.Products where ... }I want to implement caching in grids because grids usually show only the first page and no need to make query each time.
I can easily implement caching in linqDS_Selecting method.
The problem is that i dont think about pagination in linqDS_Selecting method, grid implements it instead of me.
so i can put all data in cache (i need to save in cache only the firsts pages which can be really navigated)
I tried to figure out how to hook the event when the grid passes data about its filtering and paging to linq, but i couldnt.
Does anybody know the ways how to do it?