Hi all,
I am trying to display an object in a Kendo grid in a MVC Website, however this object contains a dictionary and it seems like the grid is unable serialize it.
This is the error message I am getting:
Type 'System.Collections.Generic.Dictionary`2[[ExactModels.SalesOrderLine, ExactModels, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[ExactModels.Item, ExactModels, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' is not supported for serialization/deserialization of a dictionary, keys must be strings or objects.
I am using Kendo.Mvc.dll version 2015.2.902.545.
And this is the object which contains the dictionary that is causing the problem.
public class CustomOrder
{
[Key]
public Guid ID { get; set; }
//public SalesOrder salesOrder { get; set; }
private SalesOrder order;
public SalesOrder salesOrder
{
get { return order; }
set
{
order = value;
if (order != null)
{
this.ID = order.OrderID;
}
}
}
public Account account { get; set; }
public Dictionary<
SalesOrderLine
, Item> salesOrderLineItem { get; set; }
public Boolean Checked { get; set; }
}
Anyone any idea of how to fix this?
Thanks in advance.