Hi,
I have grid with server filtering that would retrieve and display only 20 records/page from database at a time.
Currently, the paging will have only page number 1 and is disabled. Users are not able to navigate to other pages, as it always considers there is only 1 page.
But I would like be able to show complete paging based on the total records on database (10.000 records), even though the actual record on the DataSource has only 20 records (like fake paging).
So user would still be able to navigate to other page and the custom adaptor would retrieve 20 new other records based on current page number.
Thanks beforehand.
|
public class CustomAdaptor : DataAdaptor
{
// Performs data Read operation
public override async Task<object> ReadAsync(DataManagerRequest dm, string key = null)
{
IEnumerable<Order> DataSource = Orders;
. . . . . ..
//here in the Count variable, send entire datasource count instead of filtered data count.
return dm.RequiresCounts ? new DataResult() { Result = DataSource, Count = count } : (object)DataSource;
}
}
|
Hi Vignesh,
Its all good now.
I could finally achieve what I want using CustomAdaptor.
Thanks.
How do we use the Custom adaptor with the SFGrid? Do you have an example.
Thanks
Vikram
Hi Vikram,
Query: How
do we use the Custom adaptor with the SFGrid?
From your query, we suspect that you want to know about how to use custom
adaptor in SfGrid component. We have already discussed about this topic in our
UG documentation. Kindly refer the attached
link for UG documentation and sample your
reference.
Reference: https://blazor.syncfusion.com/documentation/datagrid/custom-binding
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGrid276967475.zip
Regards,
Sarveswaran PK