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.
Hi Vignesh,
Since upgrading to 19.4.53 I can confirm this issue is fixed.
Thanks for the speedy turnaround,
Chuck