BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
When loading the data for a grid inside the DetailTemplate of a hierarchical grid we would like to remove the "count" option from the request as it adds an unnecessary delay.
The SfDataManager is configured as follows:
<SfDataManager Adaptor="Adaptors.ODataV4Adaptor"
Headers="@Headers"
Url="@($"https://localhost:123/gateway/odata/endpoint?someId={SomeId}")" />
This results in a call with the count option:
https://localhost:123/gateway/odata/endpoint?someId=132$count
As a result 2 database queries are triggered.
How can we specify that the $count option is not needed?
Hi Niels,
We are currently Validating the reported query at our end and we will update the further details shortly. Until then we appreciate your patience.
Regards,
Naveen Palanivel
Hi Niels,
Sorry for the delay
We suspect that you want to customize incoming data request and data response. If yes, then we have option to override internal methods of ODataV4Adaptor class. So we suggest you to check your scenario by overriding the ProcessQuery and ProcessResponse method of ODataV4Adaptor class. Inside this ProcessQuery and ProcessResponse method you can perform your custom customization.
Please refer and use as like the code below,
<SfGrid @ref="Grid" Height="100%" Width="100%" ...> ... <SfDataManager @ref="DataManagerRef" Url="/weatherforecast" CrossDomain="true" Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager> </SfGrid>
@code { SfGrid<WeatherForecast> Grid; public static SfDataManager DataManagerRef { get; set; } protected override void OnAfterRender(bool firstRender) { if (firstRender) { DataManagerRef.DataAdaptor = new NewODataClass(DataManagerRef); } base.OnAfterRender(firstRender); } public class NewODataClass : ODataV4Adaptor { public NewODataClass(DataManager dm) : base(dm) { } public override object ProcessQuery(DataManagerRequest queries) {
RequestOptions ActualReturnValue = (RequestOptions)(base.ProcessQuery(queries));
//you can customize the query here return ActualReturnValue; } }
}
|
Please check the above suggestion and try this from your side.
Regards,
Naveen