BoldDeskPremium customer service software with affordable pricing: $10 for 3 agents. Try it for free.
I’m using a data grid, with datamanager and a custom Dataadaptor.
I’ve only implemented the readAsync method on the Dataadaptor.
It works fine - and as my dataset is very large, I use virtualization. Normally about 60 items are requested.
The filter I apply in the ReadAsync method, from another source (another control ln the page).
I return the DataResult, with count set to the number of items under the current filter, and the items in the Result Property.
I trigger a refresh on the data grid with Grid.Refresh().
When a filter setting produces less the the requested items (say 10), the items requested show, but below them, the previous unfiltered items are also shown. Only on a second refresh, does it seem to take into account the now smaller item count, and only the 10 items are shown.
Hi Vincent,
Thanks for contacting Syncfusion support.
Query: “Only on a second refresh, does it seem to take into account the now smaller item count, and only the 10 items are shown.”
From your query, we understand that you are facing an issue while performing the external filter action. But we need some more details to validate the issue further at our end. So kindly share the following information to validate the reported issue further at our end.
The above-requested details will be very helpful in validating the reported issue at our end and providing a solution as early as possible.
Regards,
Vignesh Natarajan
Dear Vignesh, Thank you for your reply.
public override async Task<object> ReadAsync(DataManagerRequest dm, string? key = null)
{
var transactions = (await TransactionsService.GetTransactionsLocalOrServerAsync(dm.Skip, dm.Take, _mbsUnderFilter)).ToList();
IEnumerable? transactionRows = TransactionRowModelsInCurrentFilterAsync(transactions);
if (transactions.Count() < dm.Take)
{
Console.WriteLine("Not all transactions returned");
}
DataResult dataResult = new()
{
Count = TransactionsInFilterCount,
Result = transactionRows,
//FilteredRecords = transactionRows,
};
return dataResult;
}The method that is called on the grid component (Refresh).
private async void Filter_SelectedValueChanged(object? sender, ICashTransactionFilter e)
{
Console.WriteLine("Page: Filter has Changed");
if (Grid != null)
{
TransactionDatagridAdaptorComponent?.UpdateMbsUnderFilter(e); //this method does not impact the grid, but prepares some data for a future read request
await Grid.Refresh(); //this triggers the read request, and needs to be applied twice to incorporate the change in DataResult.Count
}
}
Hi Vincent,
Welcome from Syncfusion support.
Currently, we are validating your query at our end. Further details will be
updated on or before 3rd November 2022.
Until then we appreciate your patience.
Regards,
Keerthana.
Hi Vincent,
Sorry for the inconvenience caused,
We have analyzed your query and we are unable to reproduce the reported issue
at our end. If the reported issue still persists
or we misunderstood your query. Kindly share with us the simple issue reproducible
sample at your end.
Kindly get back to us if you have any further queries.
Regards,
Keerthana.