0
這裏是我的jqGrid左右試:ASP.NET Web表單 - 與ObjectDataSource控件的jqGrid填充數據(對象對象)
<JQ:JQGridColumn
DataField="ID"
PrimaryKey="true"
DataType="int"
HeaderText="NO"
Width="60" />
<JQ:JQGridColumn
DataField="CustomerID.Name"
DataType="String"
HeaderText="Customer Name"
Width="100" />
<JQ:JQGridColumn
DataField="CustomerID.Surname"
Searchable="false"
DataType="String"
HeaderText="Customer Surname
Width="100" />
和ObjectDataSource類是:
public class Order
{
private int iD;
private Customer customerID;
public Customer CustomerID
{
get { return customerID; }
set { customerID = value; }
}
public int ID
{
get { return iD; }
set { iD = value; }
}
}
和客戶類就像Order類。因此,當我嘗試這樣做時,它給出了該錯誤:
DataField = CustomerID.Name的列在數據源中不存在。(但它確實)
我該如何解決它?謝謝。