Upgrade to 19.4.52 has broken SfGrid when using CustomDataAdaptor and OnActionComplete

Hello,


As per my previous post regarding the SfAutoComplete component being broken https://www.syncfusion.com/forums/172957/upgrade-to-19-4-52-has-broken-sfautocomplete-when-using-customdataadaptor-and, the SfGrid suffers the same problem. If you use the code below you will see the grid renders two rows initially. However, if you then click the Customer Name column header twice to sort the grid, it returns "No records to display" and Read is no longer called.


<div id="ControlRegion">

 <SfGrid TValue="Order"

    AllowSorting="true"

    AllowResizing="true"

    ID="TestAutoResize">

     <SfDataManager AdaptorInstance="@typeof(CustomAdaptor)" Adaptor="Adaptors.CustomAdaptor"></SfDataManager>

                    <GridEvents

                            OnActionComplete="ActionCompleteHandler"

                            TValue="Order"></GridEvents>


    <GridColumns>

        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>

        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn>

        <GridColumn Field=@nameof(Order.EmployeeID) HeaderText="EmployeeID" Width="130"></GridColumn>

        <GridColumn Field=@nameof(Order.ShipVia) HeaderText="Ship Via" Width="120"></GridColumn>

    </GridColumns>

</SfGrid>



</div>



@code{

    public Query Query = new Query().Take(20);


    public class Order

    {

        public int? OrderID { get; set; }

        public string CustomerID { get; set; }

        public int EmployeeID { get; set; }

        public int ShipVia { get; set; }

    }


    /// <summary>

    /// Once the data is retrieved from the API set _defItem to the exact code match if there is one otherwise the first

    /// record in the list

    /// </summary>

    /// <param name="args"></param>

    protected void ActionCompleteHandler(ActionEventArgs<Order> args)

    {

        System.Console.WriteLine("ActionCompleteHandler");

    }


    public class CustomAdaptor : DataAdaptor

    {

        // Performs data Read operation

        public override object Read(DataManagerRequest dm, string key = null)

        {

            System.Console.WriteLine(string.Format("ReadAsync skip{0} take{1} requires count {2}", dm.Skip, dm.Take, dm.RequiresCounts));

            System.Console.WriteLine(string.Format("Where count {0}", dm.Where == null ? 0 : dm.Where.Count));


            return new DataResult() { Result = new List<Order>() { new Order() { OrderID = 1, CustomerID = "Sam Smith", EmployeeID = 1, ShipVia = 1 },

                                    new Order() { OrderID = 2, CustomerID = "John Smith", EmployeeID = 2, ShipVia = 1 }}, Count = 2 };


        }

    }

}


Hopefully both of these are symptoms of the same, but very high impact, bug.



3 Replies

VN Vignesh Natarajan Syncfusion Team February 17, 2022 11:50 AM UTC

Hi Chuck,  
 
Sorry for the inconvenience caused.  
 
Query: “if you then click the Customer Name column header twice to sort the grid, it returns "No records to display" and Read is no longer called. 
 
We are able to reproduce the reported issue at our end also while following the provided replication procedure. We have fixed the reported issue internally at our end and fix for the issue will be included in our upcoming patch release which is expected to be rolled out on or before 23rd February 2022.  
 
We appreciate your patience until then.   
 
Regards, 
Vignesh Natarajan 



CR Chuck Richardson February 23, 2022 10:13 PM UTC

Hi Vignesh,


Since upgrading to 19.4.53 I can confirm this issue is fixed.


Thanks for the speedy turnaround,


Chuck



MS Monisha Saravanan Syncfusion Team February 24, 2022 04:31 AM UTC

Hi Chuck, 

Thanks for the update. 

We are glad to hear that your issue has been resolved. Kindly get back to us if you have further queries. 

Regards, 
Monisha 


Loader.
Up arrow icon