OnActionComplete event fires before the page change has occured?

I register a handler for the OnActionComplete where I handle the Syncfusion.Blazor.Grids.Action.Paging event, calling the following handler:

        private async Task OnPageChanged(ActionEventArgs<MeasurementListingGridItem> args)
        {
            var records = (await _gridObj.GetCurrentViewRecords()).Select(m => m.SerialNumber).ToArray();
            Logger.LogDebug($">> Page changed: {args.PreviousPage} -> {args.CurrentPage}, {records.Length} records, from {records[0]} to {records[^1]}.");
        }

Page 1 of my grid shows 10 items, Page 2 shows 7 items. 
Alternating between page 1 and 2 produces the following log:

2021-04-28 16:23:54.643 -04:00  [DBUG]  >> Page changed: 1 -> 2, 7 records, from SN06694268 to SN06690046. 
2021-04-28 16:24:05.812 -04:00  [DBUG]  >> Page changed: 2 -> 1, 7 records, from SN06694268 to SN06690046. 
2021-04-28 16:24:16.000 -04:00  [DBUG]  >> Page changed: 1 -> 2, 10 records, from SN06694281 to SN06690050.
2021-04-28 16:24:20.693 -04:00  [DBUG]  >> Page changed: 2 -> 1, 7 records, from SN06694268 to SN06690046. 
2021-04-28 16:24:49.410 -04:00  [DBUG]  >> Page changed: 1 -> 2, 10 records, from SN06694281 to SN06690050.
2021-04-28 16:24:51.271 -04:00  [DBUG]  >> Page changed: 2 -> 1, 7 records, from SN06694268 to SN06690046. 

As can be observed, the first event (1 -> 2) correctly reports 7 records with the serial numbers matching what is displayed.

But then, it's as if the GetCurrentViewRecords() was always reporting the content of the previous page. 

In the UI, the displayed content is correct (page 1 displays 10 items and page 2 displays 7 items).

Any ideas?





Attachment: screenshots_aa9d7580.zip

1 Reply 1 reply marked as answer

VN Vignesh Natarajan Syncfusion Team April 29, 2021 04:31 AM UTC

Hi Patrice,  
 
Thanks for contacting Syncfusion support.  
 
Query: “But then, it's as if the GetCurrentViewRecords() was always reporting the content of the previous page.  
 
We have analyzed the reported issue at our end by preparing a sample as per your suggestion using 19.1.0.58 version and we are not able to reproduce the reported issue at our end. Kindly refer the below sample for your reference   
 
 
After referring the sample, if you are still facing the reported issue. Kindly get back to with following details.  
 
  1. Share your Grid code example.
  2. Share the video demonstration of the issue along with replication procedure.
  3. Share your Syncfusion.Blazor Nuget package version details.
  4. If possible try to reproduce the reported issue in provided sample and revert to us.
  5. Or share issue reproducible sample.
 
Above requested details will be very helpful for us to validate the reported query at our end and provide solution as early as possible.  
 
 
Regards, 
Vignesh Natarajan 


Marked as answer
Loader.
Up arrow icon