Hello,
I am trying to get a JavaScript grid to display data using the WebApiAdaptor data source. I am using Visual Studio 2015 Community.
I know that the Getcustomers function is getting called because it stops on a breakpoint. I can see the data that should be returned. However, the grid displays “No records to display”
I think that I must be missing something but am not sure what.
I have included code below for reference. Any help on this is greatly appreciated.
Thanks,
Jim
public static IList<EditableOrder> GetAllRecords()
{
List<EditableOrder> orders = new List<EditableOrder>();
if (orders.Count() == 0)
{
orders = (from ord in new NORTHWNDEntities().Orders.Take(200)
select new EditableOrder
{
OrderID = ord.OrderID,
OrderDate = ord.OrderDate,
CustomerID = ord.CustomerID,
EmployeeID = ord.EmployeeID,
Freight = ord.Freight,
ShipAddress = ord.ShipAddress,
ShipCity = ord.ShipCity,
ShipName = ord.ShipName,
ShipPostalCode = ord.ShipPostalCode,
ShipRegion = ord.ShipRegion,
ShipCountry = ord.ShipCountry
}).ToList();
foreach (var order in orders)
{
if (order.Freight > 30)
order.Verified = true;
else
order.Verified = false;
}
}
return orders;
}
|