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

RadGrid Calling ClientDataSource 3 times per request

2 Answers 90 Views
ClientDataSource
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 2
Jason asked on 09 Nov 2018, 11:07 AM

I'm hoping this is a silly error

this is the markup

<telerik:RadClientDataSource ID="ClaimsDataSource" runat="server" EnableServerPaging="true" EnableServerSorting="true" AllowPaging="true"  >
    <DataSource>                              
        <WebServiceDataSourceSettings BaseUrl="http://localhost:39338/" >
            <Select Url="ui/list/claims" RequestType="Get" DataType="JSON" EnableCaching="true"  />
        </WebServiceDataSourceSettings>
    </DataSource>           
    <Schema DataName="Data">
        <Model>
            <telerik:ClientDataSourceModelField FieldName="DateofLoss" DataType="Date" />
        </Model>
    </Schema>
</telerik:RadClientDataSource>
 
<telerik:RadGrid ID="grdCLaims" runat="server" ClientDataSourceID="ClaimsDataSource" AllowPaging="true" PageSize="2" AllowSorting="true"  >
    <MasterTableView ClientDataKeyNames="ClaimItemID" DataKeyNames="ClaimItemID">
        <Columns>                       
            <telerik:GridBoundColumn DataField="PolicyNumber" HeaderText="Policy Number" />
            <telerik:GridBoundColumn DataField="ClientName" HeaderText="Client" />
            <telerik:GridBoundColumn DataField="DateofLoss" HeaderText="Date of Loss" DataFormatString="{0:dd MMM yyyy}" />
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="true" />           
        <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    </ClientSettings>
</telerik:RadGrid>

 

this is the JSON that the service is returning

{
   "Data":[
      {
         "ClientName":"Ethan McWindsor",
         "PolicyNumber":"PUMA100558",
         "DateofLoss":"2015-12-09T00:00:00",
         "ClaimItemID":256,
      },
      {
         "ClientName":"Ethan McWindsor",
         "PolicyNumber":"PUMA100558",
         "DateofLoss":"2016-11-25T00:00:00",
         "ClaimItemID":413,
      }
   ],
   "Count":2
}

no matter what i do, the service is getting called three times on the in initial page load

from the network log in chrome

http://localhost:39338/ui/list/claims?take=2&skip=0&page=1&pageSize=2
 
http://localhost:39338/ui/list/claims?take=2&skip=0&page=1&pageSize=2
 
http://localhost:39338/ui/list/claims?take=10&skip=0&page=1&pageSize=10

 

(there is nothing in the code-behind)

any ideas?

2 Answers, 1 is accepted

Sort by
0
Jason
Top achievements
Rank 2
answered on 09 Nov 2018, 01:00 PM

fixed it by adding PageSize="2" to the RadClientDataSource.

0
Attila Antal
Telerik team
answered on 13 Nov 2018, 09:27 PM
Hi Jason,

The described behavior is a known issue which is logged in our System and can be accessed in our Feedback Portal at Grid with RadClientDataSource sends two requests when navigating with Grid pager.

Alternatively to the solution you have found, you may also check out the following Code Library: Retrieve filtered data from RadClientDataSource using RadGrid's event. This may also be a viable workaround for the reported issue.

Kind regards,
Attila Antal
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ClientDataSource
Asked by
Jason
Top achievements
Rank 2
Answers by
Jason
Top achievements
Rank 2
Attila Antal
Telerik team
Share this question
or