I am trying to keep the latency to a minimum when using a Radlistview which grabs it's data from sql with linq. Example of how data is currently retrieved is as follows:-
<telerik:RadDropDownList ID="RadDropDownListSort" runat="server" Skin="MetroTouch" CssClass="sortCtrl" DefaultMessage="Sort by..." Width="175px" AutoPostBack="False" OnClientItemSelecting="sortSelecting" > <Items> <telerik:DropDownListItem Text="Sort by Price" Value="SalePrice" /> <telerik:DropDownListItem Text="Sort by Year" Value="YearOfMan" /> <telerik:DropDownListItem Text="Sort by Location" Value="Location" /> <telerik:DropDownListItem Text="Sort by Make/Model" Value="Make" /> <telerik:DropDownListItem Text="Sort by Category" Value="Category" /> </Items> </telerik:RadDropDownList>
<telerik:RadListView ID="RadListView1" runat="server" DataKeyNames="ListingID,GstOptionID" ItemPlaceholderID="ListingsContainer" AllowPaging="True" PageSize="10" AllowMultiFieldSorting="True" CanRetrieveAllData="True"> <LayoutTemplate> <asp:Panel ID="ListingsContainer" runat="server" /> <table class="pagerTable pagertiles"> <tr> <td> <telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="RadListView1" PageSize="10" Skin="MetroTouch" CssClass="dataPager" > <Fields> <telerik:RadDataPagerButtonField FieldType="FirstPrev" /> <telerik:RadDataPagerButtonField FieldType="Numeric" /> <telerik:RadDataPagerButtonField FieldType="NextLast" /> <telerik:RadDataPagerPageSizeField PageSizeText="Tiles per page: " PageSizeComboWidth="62" PageSizes="20 30" /> <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go" TextBoxWidth="20" /> <telerik:RadDataPagerTemplatePageField> <PagerTemplate> <div style="float: right"> <b>Items <asp:Label runat="server" ID="CurrentPageLabel" Text="<%# Container.Owner.StartRowIndex+1%>" /> to <asp:Label runat="server" ID="TotalPagesLabel" Text="<%# IIF(Container.Owner.TotalRowCount > (Container.Owner.StartRowIndex+Container.Owner.PageSize), Container.Owner.StartRowIndex+Container.Owner.PageSize, Container.Owner.TotalRowCount) %>" /> of <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>" /> <br /> </b> </div> </PagerTemplate> </telerik:RadDataPagerTemplatePageField> </Fields> </telerik:RadDataPager> </td> </tr> </table> </LayoutTemplate> <ItemTemplate> .... </ItemTemplate> <EmptyDataTemplate> ... </EmptyDataTemplate> </telerik:RadListView>
Private Sub RadListView1_NeedDataSource(sender As Object, e As Telerik.Web.UI.RadListViewNeedDataSourceEventArgs) Handles RadListView1.NeedDataSource Dim dsTiles As IQueryable(Of ListingResults) = GetLinqListingData RadListView1.DataSource = dsTiles End SubHaving looked through the documentation and demos for the RadListview, I'm struggling to understand what amount of data is retrieved from sql and/or the server when the page first loads and on subsequent page change or sort on ajax call back. When using Iqueryable does the Radlistview grab only the data for the page shown to the user? IE 10 rows for page size of 10 retrieved from sql OR perhaps: All rows retrieved to server, but only 10 rows sent to client (user).
Presuming that it only grabs the rows for displayed items on the page, if I try to implement the usage of a shared (and/or local) cache as follows, the full set of rows would need to be retrieved from sql for first save to the cache. And on each and every page change or sort, the full set of rows is again retrieved from the cache. A suggested example of using cache:
Private Sub RadListView1_NeedDataSource(sender As Object, e As Telerik.Web.UI.RadListViewNeedDataSourceEventArgs) Handles RadListView1.NeedDataSource Dim dsTiles As List(Of ListingResults) = GetCacheData If dsTiles is nothing dsTiles = GetLinqListingData SaveCacheData(dsTiles) End If RadListView1.DataSource = dsTiles End Sub
Would greatly appreciate any explanation on how data is retrieved and any suggestion of whether cache is beneficial for short-term single user usage and longer term subsequent visitors seeking the same data.
Thank you